Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.SubProcess


    if (parsedElement instanceof Artifact) {
      Artifact currentArtifact = (Artifact) parsedElement;
      currentArtifact.setId(elementId);

      if (isInSubProcess(activeSubProcessList)) {
        final SubProcess currentSubProcess = activeSubProcessList.get(activeSubProcessList.size() - 2);
        currentSubProcess.getArtifacts().add(currentArtifact);

      } else {
        this.activeProcess.getArtifacts().add(currentArtifact);
      }
    }
View Full Code Here


   
    if (context.getSourceContainer() != context.getTargetContainer()) {
      if (context.getSourceContainer() instanceof Diagram == false) {
        Object containerBo = getFeatureProvider().getBusinessObjectForPictogramElement(context.getSourceContainer());
        if (containerBo instanceof SubProcess) {
          SubProcess subProcess = (SubProcess) containerBo;
          subProcess.removeFlowElement(gateway.getId());
          for (SequenceFlow flow : gateway.getOutgoingFlows()) {
            subProcess.removeFlowElement(flow.getId());
          }
        } else if (containerBo instanceof Lane) {
          Lane lane = (Lane) containerBo;
          lane.getFlowReferences().remove(gateway.getId());
          lane.getParentProcess().removeFlowElement(gateway.getId());
          for (SequenceFlow flow : gateway.getOutgoingFlows()) {
            lane.getParentProcess().removeFlowElement(flow.getId());
          }
        }
      } else {
        model.getBpmnModel().getMainProcess().removeFlowElement(gateway.getId());
        for (SequenceFlow flow : gateway.getOutgoingFlows()) {
          model.getBpmnModel().getMainProcess().removeFlowElement(flow.getId());
        }
      }
     
      if (context.getTargetContainer() instanceof Diagram == false) {
        Object containerBo = getFeatureProvider().getBusinessObjectForPictogramElement(context.getTargetContainer());
        if (containerBo instanceof SubProcess) {
          SubProcess subProcess = (SubProcess) containerBo;
          subProcess.addFlowElement(gateway);
          for (SequenceFlow flow : gateway.getOutgoingFlows()) {
            subProcess.addFlowElement(flow);
          }
        } else if (containerBo instanceof Lane) {
          Lane lane = (Lane) containerBo;
          lane.getFlowReferences().add(gateway.getId());
          lane.getParentProcess().addFlowElement(gateway);
View Full Code Here

* @author Tijs Rademakers
*/
public class SubProcessParser implements BpmnXMLConstants {
 
  public void parse(XMLStreamReader xtr, List<SubProcess> activeSubProcessList, Process activeProcess) {
    SubProcess subProcess = null;
    if (ATTRIBUTE_VALUE_TRUE.equalsIgnoreCase(xtr.getAttributeValue(null, ATTRIBUTE_TRIGGERED_BY))) {
     
      subProcess = new EventSubProcess();
    } else {
      subProcess = new SubProcess();
    }
    activeSubProcessList.add(subProcess);
   
    subProcess.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
    subProcess.setName(xtr.getAttributeValue(null, ATTRIBUTE_NAME));
   
    boolean async = false;
    String asyncString = xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_ACTIVITY_ASYNCHRONOUS);
    if (ATTRIBUTE_VALUE_TRUE.equalsIgnoreCase(asyncString)) {
      async = true;
    }
   
    boolean notExclusive = false;
    String exclusiveString = xtr.getAttributeValue(ACTIVITI_EXTENSIONS_NAMESPACE, ATTRIBUTE_ACTIVITY_EXCLUSIVE);
    if (ATTRIBUTE_VALUE_FALSE.equalsIgnoreCase(exclusiveString)) {
      notExclusive = true;
    }
   
    subProcess.setAsynchronous(async);
    subProcess.setNotExclusive(notExclusive);
    if(StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_ACTIVITY_DEFAULT))) {
      subProcess.setDefaultFlow(xtr.getAttributeValue(null, ATTRIBUTE_ACTIVITY_DEFAULT));
    }
   
    if(activeSubProcessList.size() > 1) {
      activeSubProcessList.get(activeSubProcessList.size() - 2).addFlowElement(subProcess);
     
View Full Code Here

    final List<Object> subProcesses = processNodes.get(SubProcess.class.getCanonicalName());

    if (subProcesses != null && !subProcesses.isEmpty()) {
      for (final Object object : subProcesses) {

        final SubProcess subProcess = (SubProcess) object;
       
        final Map<String, List<Object>> subElementsMap = new HashMap<String, List<Object>>();

        for (final FlowElement subElement : subProcess.getFlowElements()) {

          String nodeType = subElement.getClass().getCanonicalName();

          if (nodeType != null) {
            if (!subElementsMap.containsKey(nodeType)) {
View Full Code Here

    final List<Object> subProcesses = processNodes.get(SubProcess.class.getCanonicalName());

    if (subProcesses != null && !subProcesses.isEmpty()) {
      for (final Object object : subProcesses) {

        final SubProcess subProcess = (SubProcess) object;

        // Do nothing for now

      }
    }
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElementMap().get("subprocess1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess1", flowElement.getId());
    SubProcess subProcess = (SubProcess) flowElement;
    assertTrue(subProcess.getFlowElements().size() == 5);
   
    flowElement = model.getMainProcess().getFlowElementMap().get("boundaryEvent1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof BoundaryEvent);
    assertEquals("boundaryEvent1", flowElement.getId());
View Full Code Here

  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElementMap().get("outerSubProcess");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("outerSubProcess", flowElement.getId());
    SubProcess outerSubProcess = (SubProcess) flowElement;
    List<BoundaryEvent> eventList = outerSubProcess.getBoundaryEvents();
    assertEquals(1, eventList.size());
    BoundaryEvent boundaryEvent = eventList.get(0);
    assertEquals("outerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement subElement = outerSubProcess.getFlowElement("innerSubProcess");
    assertNotNull(subElement);
    assertTrue(subElement instanceof SubProcess);
    assertEquals("innerSubProcess", subElement.getId());
    SubProcess innerSubProcess = (SubProcess) subElement;
    eventList = innerSubProcess.getBoundaryEvents();
    assertEquals(1, eventList.size());
    boundaryEvent = eventList.get(0);
    assertEquals("innerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement taskElement = innerSubProcess.getFlowElement("usertask");
    assertNotNull(taskElement);
    assertTrue(taskElement instanceof UserTask);
    UserTask userTask = (UserTask) taskElement;
    assertEquals("usertask", userTask.getId());
    eventList = userTask.getBoundaryEvents();
View Full Code Here

  protected String getStencilId(FlowElement flowElement) {
    return STENCIL_EVENT_SUB_PROCESS;
  }

  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    SubProcess subProcess = (SubProcess) flowElement;
    propertiesNode.put("activitytype", "Event-Sub-Process");
    propertiesNode.put("subprocesstype", "Embedded");
    ArrayNode subProcessShapesArrayNode = objectMapper.createArrayNode();
    GraphicInfo graphicInfo = model.getGraphicInfo(flowElement.getId());
    processor.processFlowElements(subProcess.getFlowElements(), model, subProcessShapesArrayNode,
        graphicInfo.x + subProcessX, graphicInfo.y + subProcessY);
    flowElementNode.put("childShapes", subProcessShapesArrayNode);
  }
View Full Code Here

   
    flowElement = model.getMainProcess().getFlowElement("subprocess");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess", flowElement.getId());
    SubProcess subProcess = (SubProcess) flowElement;
   
    flowElement = subProcess.getFlowElement("receiveTask");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof ReceiveTask);
    assertEquals("receiveTask", flowElement.getId());
  }
View Full Code Here

   
    // sequence flows are now all on root level
    Map<String, SubProcess> subShapesMap = new HashMap<String, SubProcess>();
    for (FlowElement flowElement : bpmnModel.getMainProcess().getFlowElements()) {
      if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        fillSubShapes(subShapesMap, subProcess);
      }
    }
   
    if (subShapesMap.size() > 0) {
      List<String> removeSubFlowsList = new ArrayList<String>();
      for (FlowElement flowElement : bpmnModel.getMainProcess().getFlowElements()) {
        if (flowElement instanceof SequenceFlow) {
          SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
          if (subShapesMap.containsKey(sequenceFlow.getSourceRef())) {
            SubProcess subProcess = subShapesMap.get(sequenceFlow.getSourceRef());
            subProcess.addFlowElement(sequenceFlow);
            removeSubFlowsList.add(sequenceFlow.getId());
          }
        }
      }
      for (String flowId : removeSubFlowsList) {
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.SubProcess

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.