diff options
Diffstat (limited to 'source/com/c2kernel/lifecycle/JoinDef.java')
| -rwxr-xr-x | source/com/c2kernel/lifecycle/JoinDef.java | 65 |
1 files changed, 65 insertions, 0 deletions
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;
+ }
+}
|
