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; } }