Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.Lane


    Process process = model.getProcess(idPool);
    assertEquals(idProcess, process.getId());
    assertTrue(process.isExecutable());
    assertEquals(3, process.getLanes().size());

    Lane lane = process.getLanes().get(0);
    assertEquals("idLane1", lane.getId());
    assertEquals("Lane 1", lane.getName());
    assertEquals(4, lane.getFlowReferences().size());
    assertTrue(lane.getFlowReferences().contains("startevent"));
    assertTrue(lane.getFlowReferences().contains("usertask1"));
    assertTrue(lane.getFlowReferences().contains("usertask6"));
    assertTrue(lane.getFlowReferences().contains("endevent"));
   
    lane = process.getLanes().get(1);
    assertEquals("idLane2", lane.getId());
    assertEquals("Lane 2", lane.getName());
    assertEquals(2, lane.getFlowReferences().size());
    assertTrue(lane.getFlowReferences().contains("usertask2"));
    assertTrue(lane.getFlowReferences().contains("usertask5"));
   
    lane = process.getLanes().get(2);
    assertEquals("idLane3", lane.getId());
    assertEquals("Lane 3", lane.getName());
    assertEquals(2, lane.getFlowReferences().size());
    assertTrue(lane.getFlowReferences().contains("usertask3"));
    assertTrue(lane.getFlowReferences().contains("usertask4"));
   
    assertNotNull(process.getFlowElement("startevent"));
    assertNotNull(process.getFlowElement("usertask1"));
    assertNotNull(process.getFlowElement("usertask2"));
    assertNotNull(process.getFlowElement("usertask3"));
View Full Code Here


    assertEquals("pool1", pool.getId());
    assertEquals("Pool", pool.getName());
    Process process = model.getProcess(pool.getId());
    assertNotNull(process);
    assertEquals(2, process.getLanes().size());
    Lane lane = process.getLanes().get(0);
    assertEquals("lane1", lane.getId());
    assertEquals("Lane 1", lane.getName());
    assertEquals(2, lane.getFlowReferences().size());
    lane = process.getLanes().get(1);
    assertEquals("lane2", lane.getId());
    assertEquals("Lane 2", lane.getName());
    assertEquals(2, lane.getFlowReferences().size());
    FlowElement flowElement = process.getFlowElement("flow1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SequenceFlow);
  }
View Full Code Here

    if (parentElement instanceof Process) {
      ((Process) parentElement).addFlowElement(flowElement);
    } else if (parentElement instanceof SubProcess) {
      ((SubProcess) parentElement).addFlowElement(flowElement);
    } else if (parentElement instanceof Lane) {
      Lane lane = (Lane) parentElement;
      lane.getFlowReferences().add(flowElement.getId());
      lane.getParentProcess().addFlowElement(flowElement);
    }
  }
View Full Code Here

  }
 
  public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
    if (parentElement instanceof Lane == false) return;
   
    Lane lane = (Lane) parentElement;
    lane.getFlowReferences().add(xtr.getElementText());
  }
View Full Code Here

        for (JsonNode laneNode : laneArrayNode) {
          // should be a lane, but just check to be certain
          String laneStencilId = BpmnJsonConverterUtil.getStencilId(laneNode);
          if (STENCIL_LANE.equals(laneStencilId)) {
            emptyPoolFound = false;
            Lane lane = new Lane();
            lane.setId(BpmnJsonConverterUtil.getElementId(laneNode));
            lane.setName(JsonConverterUtil.getPropertyValueAsString(PROPERTY_NAME, laneNode));
            lane.setParentProcess(process);
            process.getLanes().add(lane);
           
            processJsonElements(laneNode.get(EDITOR_CHILD_SHAPES), modelNode, lane, shapeMap);
          }
        }
View Full Code Here

* @author Tijs Rademakers
*/
public class LaneParser implements BpmnXMLConstants {
 
  public void parse(XMLStreamReader xtr, Process activeProcess, BpmnModel model) throws Exception {
    Lane lane = new Lane();
    BpmnXMLUtil.addXMLLocation(lane, xtr);
    lane.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
    lane.setName(xtr.getAttributeValue(null, ATTRIBUTE_NAME));
    lane.setParentProcess(activeProcess);
    activeProcess.getLanes().add(lane);
    BpmnXMLUtil.parseChildElements(ELEMENT_LANE, lane, xtr, model);
  }
View Full Code Here

     
      if (parentBo instanceof SubProcess) {
        final SubProcess subProcess = (SubProcess) parentBo;
        subProcess.addArtifact(association);
      } else if (parentBo instanceof Lane) {
        final Lane lane = (Lane) parentBo;
        lane.getParentProcess().addArtifact(association);
      }
    }
   
    return association;
  }
View Full Code Here

      Object parentObject = getBusinessObjectForPictogramElement(parentContainer);
      if (parentObject instanceof SubProcess) {
        ((SubProcess) parentObject).addFlowElement(sequenceFlow);

      } else if (parentObject instanceof Lane) {
        Lane lane = (Lane) parentObject;
        lane.getParentProcess().addFlowElement(sequenceFlow);
      }
    }
   
    source.getOutgoingFlows().add(sequenceFlow);
    target.getIncomingFlows().add(sequenceFlow);
View Full Code Here

    Object parentBo = getFeatureProvider().getBusinessObjectForPictogramElement(context.getTargetContainer());
    Pool parentPool = null;
    if (parentBo instanceof Pool) {
      parentPool = (Pool) parentBo;
    } else {
      Lane lane = (Lane) parentBo;
      for (Pool pool : model.getBpmnModel().getPools()) {
        if (pool.getProcessRef().equals(lane.getParentProcess().getId())) {
          parentPool = pool;
          break;
        }
      }
    }

    if (parentPool == null)
      return null;

    ContainerShape poolShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(parentPool);
    Process poolProcess = model.getBpmnModel().getProcess(parentPool.getId());

    if (poolProcess == null)
      return null;

    List<Lane> lanes = poolProcess.getLanes();
    int x = 0;
    int y = 0;
    int width = 0;
    int height = 0;
    if (lanes.size() == 0) {
      x = 20;
      y = 0;
      width = poolShape.getGraphicsAlgorithm().getWidth() - 20;
      height = poolShape.getGraphicsAlgorithm().getHeight();

    } else {
      ContainerShape lastLaneShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(lanes.get(lanes.size() - 1));
      x = lastLaneShape.getGraphicsAlgorithm().getX();
      y = lastLaneShape.getGraphicsAlgorithm().getY() + lastLaneShape.getGraphicsAlgorithm().getHeight();
      width = lastLaneShape.getGraphicsAlgorithm().getWidth();
      height = lastLaneShape.getGraphicsAlgorithm().getHeight();
    }

    Lane newLane = new Lane();
    newLane.setId(getNextId(newLane));
    newLane.setName("New lane");
    newLane.setParentProcess(poolProcess);
    poolProcess.getLanes().add(newLane);

    ResizeShapeContext resizeContext = new ResizeShapeContext(poolShape);
    resizeContext.setSize(poolShape.getGraphicsAlgorithm().getWidth(), poolShape.getGraphicsAlgorithm().getHeight() + height);
    resizeContext.setLocation(poolShape.getGraphicsAlgorithm().getX(), poolShape.getGraphicsAlgorithm().getY());
View Full Code Here

            Object parentObject = getFeatureProvider().getBusinessObjectForPictogramElement(oldParentContainer);
            if (parentObject instanceof SubProcess) {
              ((SubProcess) parentObject).removeFlowElement(flow.getId());

            } else if (parentObject instanceof Lane) {
              Lane lane = (Lane) parentObject;
              lane.getParentProcess().removeFlowElement(flow.getId());
            }
          }
         
          if (newParentContainer instanceof Diagram) {
            ModelHandler.getModel(EcoreUtil.getURI(getDiagram())).getBpmnModel().getMainProcess().addFlowElement(flow);

          } else {
            Object parentObject = getBusinessObjectForPictogramElement(newParentContainer);
            if (parentObject instanceof SubProcess) {
              ((SubProcess) parentObject).addFlowElement(flow);

            } else if (parentObject instanceof Lane) {
              Lane lane = (Lane) parentObject;
              lane.getParentProcess().addFlowElement(flow);
            }
          }
        }
       
        // remove old source
View Full Code Here

TOP

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

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.