1 10 11 package org.enhydra.jawe.graph; 12 13 import org.enhydra.jawe.*; 14 import org.enhydra.jawe.xml.*; 15 import org.enhydra.jawe.xml.elements.*; 16 import org.jgraph.graph.*; 17 18 import java.util.*; 19 import javax.swing.*; 20 21 24 public class BlockActivityGraph extends ProcessGraph { 25 26 private BlockActivity myBlockActivity; 27 31 public BlockActivityGraph() { 32 this((GraphModel)null,null); 33 } 34 35 38 public BlockActivityGraph(GraphModel model,BlockActivityEditor pe) { 39 super(model,pe); 40 } 41 42 public void setMyBlockActivity (BlockActivity ba) { 43 myBlockActivity=ba; 44 } 45 46 public BlockActivity getMyBlockActivity () { 47 return myBlockActivity; 48 } 49 50 protected void updateXMLObjectsBeforeChecking () { 51 Set blockActs=getWorkflowManager().getBlockActivities(true); 53 blockActs.add(myBlockActivity); 55 Iterator itBas=blockActs.iterator(); 56 while (itBas.hasNext()) { 57 BlockActivity ba=(BlockActivity)itBas.next(); 58 ProcessEditor bwe=ba.getImplementationEditor(); 59 org.enhydra.jawe.xml.elements.Activity bap= 60 (org.enhydra.jawe.xml.elements.Activity) 61 ba.getUserObject(); 62 bap.setStartDescriptions(Utils.getStartDescriptions(bwe)); 63 bap.setEndDescriptions(Utils.getEndDescriptions(bwe)); 64 } 65 } 66 67 public boolean checkLogic (boolean fullCheck) { 68 PackageValidator pv=new PackageValidator(getXMLPackage(),true,true,false,false, 69 JaWEConfig.getInstance().getAllowUndefinedStartActivity(), 70 JaWEConfig.getInstance().getAllowUndefinedEndActivity(), 71 JaWEConfig.getInstance().getEncoding()); 72 boolean isLogical=pv.checkActivitySet((ActivitySet)getXPDLObject(),fullCheck); 73 basicLogicError=pv.getBasicLogicError((ActivitySet)getXPDLObject()); 74 logicErrors=pv.getLogicErrors((ActivitySet)getXPDLObject()); 75 return isLogical; 76 } 77 78 81 public XMLElement getXPDLObject () { 82 try { 83 String ID=myBlockActivity.getBlockID(); 84 ActivitySet as=((ActivitySets)((WorkflowProcess)xmlObject). 85 get("ActivitySets")).getActivitySet(ID); 86 return as; 87 } catch (Exception ex) { 88 return null; 89 } 90 } 91 92 } 93 94 95 | Popular Tags |