Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.Process


    public void revisitProcessDoc(Definitions def) {
        List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
            if(root instanceof Process) {
                Process process = (Process) root;
                if(this.processDocs != null && this.processDocs.length() > 0) {
                    process.getDocumentation().add(createDocumentation(wrapInCDATABlock(this.processDocs)));
                }
            }
        }
    }
View Full Code Here


    public void updateShapeBounds(Definitions def, BPMNPlane plane, BaseElement ele) {
        List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
            if(root instanceof Process) {
                Process process = (Process) root;
                List<FlowElement> flowElements = process.getFlowElements();

                boolean foundAsTopLevel = false;
                for(FlowElement fe : flowElements) {
                    if(fe.getId().equals(ele.getId())) {
                        foundAsTopLevel = true;
View Full Code Here

    public void revisitMultiInstanceTasks(Definitions def) {
        try {
        List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
            if(root instanceof Process) {
                Process process = (Process) root;
                List<FlowElement> flowElements = process.getFlowElements();
                for(FlowElement fe : flowElements) {
                    if(fe instanceof Task) {
                        Task task = (Task) fe;
                        Iterator<FeatureMap.Entry> iter = task.getAnyAttribute().iterator();
                        while(iter.hasNext()) {
                            FeatureMap.Entry entry = iter.next();
                            if(entry.getEStructuralFeature().getName().equals("mitask")) {
                                String multiValue = (String) entry.getValue();
                                String[] multiValueParts = multiValue.split("@");
                                if(multiValueParts != null && multiValueParts.length == 4) {
                                    String miCollectionInput = (multiValueParts[0].equals(" ") ? "" : multiValueParts[0]);
                                    String miCollectionOutput = (multiValueParts[1].equals(" ") ? "" : multiValueParts[1]);
                                    String miDataInput = (multiValueParts[2].equals(" ") ? "" : multiValueParts[2]);
                                    String miDataOutput = (multiValueParts[3].equals(" ") ? "" : multiValueParts[3]);

                                    MultiInstanceLoopCharacteristics loopCharacteristics = Bpmn2Factory.eINSTANCE.createMultiInstanceLoopCharacteristics();

                                    if(miCollectionInput != null && miCollectionInput.length() > 0) {
                                        List<Property> properties = process.getProperties();
                                        for(Property prop : properties) {
                                            if(prop.getId() != null && prop.getId().equals(miCollectionInput)) {

                                                DataInput miCollectionInputDI = Bpmn2Factory.eINSTANCE.createDataInput();
                                                miCollectionInputDI.setName("miinputCollection");
                                                ItemDefinition miCollectionInputDIItemDefinition = Bpmn2Factory.eINSTANCE.createItemDefinition();
                                                miCollectionInputDIItemDefinition.setStructureRef("java.util.Collection");
                                                def.getRootElements().add(miCollectionInputDIItemDefinition);
                                                miCollectionInputDI.setItemSubjectRef(miCollectionInputDIItemDefinition);

                                                task.getIoSpecification().getDataInputs().add(miCollectionInputDI);

                                                if(task.getIoSpecification().getInputSets() == null || task.getIoSpecification().getInputSets().size() < 1) {
                                                    InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet();
                                                    task.getIoSpecification().getInputSets().add(inset);
                                                }
                                                task.getIoSpecification().getInputSets().get(0).getDataInputRefs().add(miCollectionInputDI);

                                                loopCharacteristics.setLoopDataInputRef(miCollectionInputDI);


                                                DataInputAssociation miCollectionInputDataInputAssociation = Bpmn2Factory.eINSTANCE.createDataInputAssociation();
                                                miCollectionInputDataInputAssociation.getSourceRef().add(prop);
                                                miCollectionInputDataInputAssociation.setTargetRef(miCollectionInputDI);

                                                task.getDataInputAssociations().add(miCollectionInputDataInputAssociation);

                                                break;
                                            }
                                        }
                                    }

                                    if(miCollectionOutput != null && miCollectionOutput.length() > 0) {
                                        List<Property> properties = process.getProperties();
                                        for(Property prop : properties) {
                                            if(prop.getId() != null && prop.getId().equals(miCollectionOutput)) {


View Full Code Here

    public void updateIDs(Definitions def) {
      // data object id update
      List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
          if(root instanceof Process) {
            Process process = (Process) root;
            List<FlowElement> flowElements = process.getFlowElements();
              for(FlowElement fe : flowElements) {
                if(fe instanceof DataObject) {
                  DataObject da = (DataObject) fe;
                  if(da.getName() != null) {
                    String daId = da.getName().trim();
View Full Code Here

      List<RootElement> rootElements =  def.getRootElements();
      List<ItemDefinition> itemDefinitionsToAddUnfiltered = new ArrayList<ItemDefinition>();
        List<ItemDefinition> itemDefinitionsToAddFiltered = new ArrayList<ItemDefinition>();
        for(RootElement root : rootElements) {
          if(root instanceof Process) {
            Process process = (Process) root;
            List<FlowElement> flowElements = process.getFlowElements();
              for(FlowElement fe : flowElements) {
                if(fe instanceof DataObject) {
                  DataObject da = (DataObject) fe;
                  ItemDefinition itemdef =  Bpmn2Factory.eINSTANCE.createItemDefinition();
                  itemdef.setId("_" + da.getId() + "Item");
                  Iterator<FeatureMap.Entry> iter = da.getAnyAttribute().iterator();
                      while(iter.hasNext()) {
                          FeatureMap.Entry entry = iter.next();
                          if(entry.getEStructuralFeature().getName().equals("datype")) {
                            String typeValue = (String) entry.getValue();
                            if(typeValue != null && !typeValue.equals("None")) {
                              itemdef.setStructureRef((String) entry.getValue());
                            }
                          }
                      }
                      da.setItemSubjectRef(itemdef);
                        itemDefinitionsToAddUnfiltered.add(itemdef);
                }
              }
          }
        }
        for(ItemDefinition itemDef : itemDefinitionsToAddUnfiltered) {
            boolean foundItemDef = false;
            for(RootElement ele : rootElements) {
                if(ele instanceof ItemDefinition) {
                    ItemDefinition idef = (ItemDefinition) ele;
                    if(idef.getId().equals(itemDef.getId())) {
                        foundItemDef = true;
                        break;
                    }
                }
            }
            if(!foundItemDef) {
                itemDefinitionsToAddFiltered.add(itemDef);
            }
        }

        for(ItemDefinition itemDefFil : itemDefinitionsToAddFiltered) {
            def.getRootElements().add(itemDefFil);
        }
       
        for(RootElement root : rootElements) {
          if(root instanceof Process) {
            Process process = (Process) root;
              List<Artifact> artifactElements = process.getArtifacts();
              for(Artifact af : artifactElements) {
                if(af instanceof Association) {
                  Association as = (Association) af;
                  if(as.getSourceRef() != null && as.getSourceRef() instanceof DataObject
                      && as.getTargetRef() != null && (as.getTargetRef() instanceof Task || as.getTargetRef() instanceof ThrowEvent)) {
View Full Code Here

   
    public void revisitTaskAssociations(Definitions def) {
      List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
            if(root instanceof Process) {
                Process process = (Process) root;
                List<FlowElement> flowElements = process.getFlowElements();
                for(FlowElement fe : flowElements) {
                  if(fe instanceof Task) {
                    Task t = (Task) fe;
                    if(t.getDataInputAssociations() != null) {
                      List<DataInputAssociation> inputList = t.getDataInputAssociations();
View Full Code Here

   
    public void revisitLanes(Definitions def) {
        List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
            if(root instanceof Process) {
                Process process = (Process) root;
                if((process.getLaneSets() == null || process.getLaneSets().size() < 1) && _lanes.size() > 0) {
                  LaneSet ls = Bpmn2Factory.eINSTANCE.createLaneSet();
                  for(Lane lane : _lanes) {
                    ls.getLanes().add(lane);
                    List<FlowNode> laneFlowNodes = lane.getFlowNodeRefs();
                    for(FlowNode fl : laneFlowNodes) {
                      process.getFlowElements().add(fl);
                    }
                  }
                  process.getLaneSets().add(ls);
                }
            }
        }
    }
View Full Code Here

   
    public void revisitArtifacts(Definitions def) {
      List<RootElement> rootElements =  def.getRootElements();
        for(RootElement root : rootElements) {
            if(root instanceof Process) {
                Process process = (Process) root;
                for(Artifact a : _artifacts) {
                  process.getArtifacts().add(a);
                }
            }
        }
    }
View Full Code Here

      List<RootElement> rootElements =  def.getRootElements();
      Category defaultCat = Bpmn2Factory.eINSTANCE.createCategory();
      defaultCat.setName("default");
        for(RootElement root : rootElements) {
           if(root instanceof Process) {
             Process process = (Process) root;
             List<Artifact> processArtifacts = process.getArtifacts();
             if(processArtifacts != null) {
               for(Artifact ar : processArtifacts) {
                 if(ar instanceof Group) {
                   Group group = (Group) ar;
                   Iterator<FeatureMap.Entry> iter = group.getAnyAttribute().iterator();
View Full Code Here

                // elements
                // in order to find our activity name
                List<RootElement> re = def.getRootElements();
                for (RootElement r : re) {
                  if (r instanceof Process) {
                    Process p = (Process) r;
                    List<FlowElement> fes = p
                        .getFlowElements();
                    for (FlowElement f : fes) {
                      if (f instanceof Activity
                          && ((Activity) f)
                              .getName()
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.Process

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.