1 10 11 package org.enhydra.jawe.graph; 12 13 import org.enhydra.jawe.xml.*; 14 import org.enhydra.jawe.xml.elements.*; 15 16 import org.jgraph.graph.*; 17 18 import java.util.*; 19 import java.awt.*; 20 import javax.swing.*; 21 import org.enhydra.jawe.*; 22 23 27 28 32 public class Subflow extends Activity { 33 34 37 public Subflow() { 38 this(null); 39 } 40 41 44 public Subflow(Object userObject) { 45 super(userObject); 46 } 47 48 56 public void showSubflow (Window parentWindow,org.enhydra.jawe.xml.elements.Package pkg) { 57 WorkflowProcess wp=getReferencedWorkflowProcess(pkg); 58 if (wp!=null) { 59 wp=JaWE.getInstance().showProcess(parentWindow,wp,wp.getID()); 60 getXMLSubflow().set("WorkflowProcess",wp); 61 } 62 } 63 64 public WorkflowProcess getReferencedWorkflowProcess (org.enhydra.jawe.xml.elements.Package pkg) { 65 String ID=getProcessID(); 66 return pkg.getWorkflowProcess(ID); 67 } 68 69 74 private String getProcessID () { 75 SubFlow s=getXMLSubflow(); 76 XMLComplexChoice wp=(XMLComplexChoice)s.get("WorkflowProcess"); 77 78 Object choosenWorkflow=wp.getChoosen(); 79 String subflowID; 80 81 if (choosenWorkflow!=null && 82 choosenWorkflow instanceof WorkflowProcess) { 83 subflowID=((WorkflowProcess)choosenWorkflow).getID(); 84 } else { 85 subflowID=choosenWorkflow.toString(); 86 } 87 return subflowID; 88 } 89 90 94 private SubFlow getXMLSubflow () { 95 return ((org.enhydra.jawe.xml.elements.Activity) 96 userObject).getSubflow(); 97 } 98 99 } 100 | Popular Tags |