Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.FlowElement


  protected String getResource() {
    return "usertaskmodel.bpmn";
  }
 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElementMap().get("usertask");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("usertask", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertEquals("usertask", userTask.getId());
    assertEquals("User task", userTask.getName());
    assertEquals("testKey", userTask.getFormKey());
    assertEquals(40l, userTask.getPriority().longValue());
View Full Code Here


    // we already verified, that we paste directly in the diagram
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
    List<FlowElement> copyList = model.getClipboard();

    for (FlowElement element : copyList) {
      FlowElement clone = CloneUtil.clone(element, getDiagram());
     
      AddContext addContext = new AddContext(new AreaContext(), clone);
      IAddFeature addFeature = getFeatureProvider().getAddFeature(addContext);
      PictogramElement pictogram = getFeatureProvider().getPictogramElementForBusinessObject(element);
      addContext.setLocation(pictogram.getGraphicsAlgorithm().getX() + PASTE_OFFSET, pictogram.getGraphicsAlgorithm().getY() + PASTE_OFFSET);
View Full Code Here

 
  private void processFlowElements(Collection<FlowElement> flowElementList, BaseElement parentScope) {
    for (FlowElement flowElement : flowElementList) {
      if (flowElement instanceof SequenceFlow) {
        SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
        FlowElement sourceElement = getFlowElementFromScope(sequenceFlow.getSourceRef(), parentScope);
        if (sourceElement != null) {
          sourceElement.addOutgoingFlow(sequenceFlow);
        }
      } else if (flowElement instanceof BoundaryEvent) {
        BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
        FlowElement attachedToElement = getFlowElementFromScope(boundaryEvent.getAttachedToRefId(), parentScope);
        if(attachedToElement != null) {
          boundaryEvent.setAttachedToRef((Activity) attachedToElement);
          ((Activity) attachedToElement).getBoundaryEvents().add(boundaryEvent);
        }
      } else if(flowElement instanceof SubProcess) {
View Full Code Here

      }
    }
  }
 
  private FlowElement getFlowElementFromScope(String elementId, BaseElement scope) {
    FlowElement flowElement = null;
    if (scope instanceof Process) {
      flowElement = ((Process) scope).getFlowElement(elementId);
    } else if (scope instanceof SubProcess) {
      flowElement = ((SubProcess) scope).getFlowElement(elementId);
    }
View Full Code Here

        final Lane lane = (Lane) parent;
       
        // for flow elements, the lane gets informed about the flow elements Id
        if (baseElement instanceof FlowElement)
        {
          final FlowElement flowElement = (FlowElement) baseElement;
          lane.getFlowReferences().add(flowElement.getId());
        }
 
        addFlowNodeOrArtifact(baseElement, lane.getParentProcess());
       
      } else if (parent instanceof Activity) {
View Full Code Here

    process.setId("myProcess");
    bpmnModel.addProcess(process);
  }
 
  public FlowElement getFlowElement(String ref) {
    FlowElement element = null;
    if (bpmnModel != null && StringUtils.isNotEmpty(ref)) {
      element = bpmnModel.getFlowElement(ref);
    }
    return element;
  }
View Full Code Here

      }
    }
   
    if(parsedElement instanceof FlowElement) {
     
      FlowElement currentFlowElement = (FlowElement) parsedElement;
      currentFlowElement.setId(elementId);
      currentFlowElement.setName(elementName);
     
      if(currentFlowElement instanceof Activity) {
       
        Activity activity = (Activity) currentFlowElement;
        activity.setAsynchronous(async);
View Full Code Here

    // retrieve name from business model
    String businessName = null;
    Object bo = getBusinessObjectForPictogramElement(pictogramElement);
    if (bo instanceof FlowElement) {
      FlowElement flowElement = (FlowElement) bo;
      businessName = flowElement.getName();
    }

    // update needed, if names are different
    boolean updateNameNeeded = ((pictogramName == null && businessName != null) ||
        (pictogramName != null && !pictogramName.equals(businessName)));
View Full Code Here

    // retrieve name from business model
    String businessName = null;
    PictogramElement pictogramElement = context.getPictogramElement();
    Object bo = getBusinessObjectForPictogramElement(pictogramElement);
    if (bo instanceof FlowElement) {
      FlowElement flowElement = (FlowElement) bo;
      businessName = flowElement.getName();
    }

    // Set name in pictogram model
    if (pictogramElement instanceof ContainerShape) {
      ContainerShape cs = (ContainerShape) pictogramElement;
View Full Code Here

 
  private void validateModel(BpmnModel model) {
    assertEquals("simpleProcess", model.getMainProcess().getId());
    assertEquals("Simple process", model.getMainProcess().getName());
   
    FlowElement flowElement = model.getMainProcess().getFlowElement("flow1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
    assertEquals("flow1", flowElement.getId());
   
    flowElement = model.getMainProcess().getFlowElement("catchEvent");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof IntermediateCatchEvent);
    assertEquals("catchEvent", flowElement.getId());
    IntermediateCatchEvent catchEvent = (IntermediateCatchEvent) flowElement;
    assertTrue(catchEvent.getEventDefinitions().size() == 1);
    EventDefinition eventDefinition = catchEvent.getEventDefinitions().get(0);
    assertTrue(eventDefinition instanceof TimerEventDefinition);
    TimerEventDefinition timerDefinition = (TimerEventDefinition) eventDefinition;
    assertEquals("PT5M", timerDefinition.getTimeDuration());
   
    flowElement = model.getMainProcess().getFlowElement("flow1Condition");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
    assertEquals("flow1Condition", flowElement.getId());
    SequenceFlow flow = (SequenceFlow) flowElement;
    assertEquals("${number <= 1}", flow.getConditionExpression());
  }
View Full Code Here

TOP

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

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.