Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.Gateway


          activity.setDefaultFlow(defaultFlow);
        }
      }
     
      if (currentFlowElement instanceof Gateway) {
        Gateway gateway = (Gateway) currentFlowElement;
        if (StringUtils.isNotEmpty(defaultFlow)) {
          gateway.setDefaultFlow(defaultFlow);
        }
       
        gateway.setAsynchronous(async);
        gateway.setNotExclusive(notExclusive);
      }
     
      if(currentFlowElement instanceof DataObject) {
        if (!activeSubProcessList.isEmpty()) {
          activeSubProcessList.get(activeSubProcessList.size() - 1).getDataObjects().add((ValuedDataObject)parsedElement);
View Full Code Here


        }
      }
    }
   
    if (baseElement instanceof Gateway) {
      final Gateway gateway = (Gateway) baseElement;
      if (gateway.isAsynchronous()) {
        writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_ASYNCHRONOUS, ATTRIBUTE_VALUE_TRUE, xtw);
        if (gateway.isNotExclusive()) {
          writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_EXCLUSIVE, ATTRIBUTE_VALUE_FALSE, xtw);
        }
      }
      if (StringUtils.isNotEmpty(gateway.getDefaultFlow())) {
        FlowElement defaultFlowElement = model.getFlowElement(gateway.getDefaultFlow());
        if (defaultFlowElement instanceof SequenceFlow) {
          writeDefaultAttribute(ATTRIBUTE_DEFAULT, gateway.getDefaultFlow(), xtw);
        }
      }
    }
   
    writeAdditionalAttributes(baseElement, model, xtw);
View Full Code Here

    super(fp);
  }

  @Override
  public PictogramElement add(IAddContext context) {
    final Gateway addedGateway = (Gateway) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH CIRCLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);
View Full Code Here

    super(fp);
  }

  @Override
  public PictogramElement add(IAddContext context) {
    final Gateway addedGateway = (Gateway) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH CIRCLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);
View Full Code Here

  @Override
  protected void postMoveShape(IMoveShapeContext context) {
    final Shape shape = context.getShape();

    // get the gateway itself to determine its boundary events
    final Gateway gateway = (Gateway) getBusinessObjectForPictogramElement(shape);
   
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
   
    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);
          for (SequenceFlow flow : gateway.getOutgoingFlows()) {
            lane.getParentProcess().addFlowElement(flow);
          }
        }
      } else {
        model.getBpmnModel().getMainProcess().addFlowElement(gateway);
        for (SequenceFlow flow : gateway.getOutgoingFlows()) {
          model.getBpmnModel().getMainProcess().addFlowElement(flow);
        }
      }
    }
  }
View Full Code Here

TOP

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

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.