From 254ee6f47eebfc00462c10756a92066e82cc1a96 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 21 Jun 2011 15:46:02 +0200 Subject: Initial commit --- source/com/c2kernel/lifecycle/JoinDef.java | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 source/com/c2kernel/lifecycle/JoinDef.java (limited to 'source/com/c2kernel/lifecycle/JoinDef.java') diff --git a/source/com/c2kernel/lifecycle/JoinDef.java b/source/com/c2kernel/lifecycle/JoinDef.java new file mode 100755 index 0000000..71bc95c --- /dev/null +++ b/source/com/c2kernel/lifecycle/JoinDef.java @@ -0,0 +1,65 @@ +package com.c2kernel.lifecycle; + +import com.c2kernel.lifecycle.instance.Join; +import com.c2kernel.lifecycle.instance.WfVertex; + +/** + * @version $Revision: 1.18 $ $Date: 2005/09/29 10:18:31 $ + * @author $Author: abranson $ + */ +public class JoinDef extends WfVertexDef +{ + /** + * @see java.lang.Object#Object() + */ + public JoinDef() + { + } + /** + * @see com.c2kernel.lifecycle.WfVertexDef#verify() + */ + public boolean verify() + { + mErrors.removeAllElements(); + int nbOutEdges = getOutEdges().length; + int nbInEdges = getInEdges().length; + String type = (String) getProperties().get("Type"); + if (nbInEdges < 1) + { + mErrors.add("not enough previous"); + return false; + } + if (type != null && type.equals("Route")) + { + if (nbInEdges > 1) + { + mErrors.add("Bad nb of previous"); + return false; + } + } + if (nbOutEdges > 1) + { + mErrors.add("too many next"); + return false; + } + if (nbOutEdges == 0) + { + if (!((CompositeActivityDef) getParent()).hasGoodNumberOfActivity()) + { + mErrors.add("too many endpoints"); + return false; + } + } + return true; + } + public boolean isJoin() + { + return true; + } + + public WfVertex instantiate() { + Join newJoin = new Join(); + configureInstance(newJoin); + return newJoin; + } +} -- cgit v1.2.3