Examples of Lane


Examples of org.eclipse.bpmn2.Lane

      BaseElement parentElement, Map<String, JsonNode> shapeMap,Map<String, List<JsonNode>> sourceAndTargetMap,Definitions model) {
      for (JsonNode shapeNode : shapesArrayNode) {
        String stencilId = BpmnJsonConverterUtil.getStencilId(shapeNode);
        //先处理lane,lane中会包含child元素
        if(STENCIL_LANE.equals(stencilId)){
          Lane lane = Bpmn2Factory.eINSTANCE.createLane();
          String override = BpmnJsonConverterUtil.getElementId(shapeNode);
          String laneNameString = JsonConverterUtil.getPropertyValueAsString(PROPERTY_NAME, shapeNode);
          lane.setId(override);
          lane.setName(laneNameString);
          if(parentElement instanceof Lane){
            Lane parentLane = ((Lane)parentElement);
            if(parentLane.getChildLaneSet() == null){
              LaneSet laneSet = Bpmn2Factory.eINSTANCE.createLaneSet();
                laneSet.getLanes().add(lane);
                parentLane.setChildLaneSet(laneSet);
            }else{
              parentLane.getChildLaneSet().getLanes().add(lane);
            }
          }else if(parentElement instanceof Process){
            Process process = (Process)parentElement;
            if(process.getLaneSets().size() >0){
              process.getLaneSets().get(0).getLanes().add(lane);
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

      ((Process) parentElement).getFlowElements().add(flowElement);
    } else if (parentElement instanceof SubProcess) {
      ((SubProcess) parentElement).getFlowElements().add(flowElement);
    } else if (parentElement instanceof Lane) {
      Process process = (Process)this.model.getRootElements().get(0);
      Lane lane = (Lane) parentElement;
      process.getFlowElements().add(flowElement);
      lane.getFlowNodeRefs().add((FlowNode)flowElement);
    }
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

  private void modifyModelStructure(IMoveShapeContext context) {
    try {
      Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context
          .getTargetContainer());
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      Lane movedLane = getMovedLane(context);
      handler.moveLane(movedLane, targetParticipant);
      Participant internalParticipant = handler.getParticipant(getDiagram());
      LaneSet laneSet = null;
      for (LaneSet set : internalParticipant.getProcessRef().getLaneSets()) {
        if (set.getLanes().contains(movedLane)) {
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    modifyModelStructure(context);
    FeatureSupport.redraw(context.getSourceContainer());
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());
    Participant internalParticipant = null;

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    GraphicsAlgorithm ga = ((ContainerShape) context.getPictogramElement()).getGraphicsAlgorithm();

    int i = compare(ga.getHeight(), ga.getWidth(), context.getHeight(), context.getWidth());

    Lane lane = (Lane) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), Lane.class);

    if (i < 0 && lane.getFlowNodeRefs().size() == 0) {
      return true;
    }

    if (i > 0) {
      return true;
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    super(fp);
  }

  @Override
  public boolean canMoveShape(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    boolean moveableHasFlowNodes = movedLane.getFlowNodeRefs().size() > 0;

    Lane targetLane = getTargetLane(context);
    boolean targetHasFlowNodeRefs = targetLane.getFlowNodeRefs().size() > 0;

    if (!moveableHasFlowNodes && !targetHasFlowNodeRefs) {
      return true;
    }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    ContainerShape targetContainer = context.getTargetContainer();
    return (Lane) getBusinessObjectForPictogramElement(targetContainer);
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Lane toLane = getTargetLane(context);

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      Participant participant = handler.getParticipant(toLane);
      handler.moveLane(movedLane, participant);
    } catch (IOException e) {
      Activator.logError(e);
    }

    Participant sourceParticipant = (Participant) getBusinessObjectForPictogramElement(context.getSourceContainer());

    LaneSet laneSet = null;
    for (LaneSet set : sourceParticipant.getProcessRef().getLaneSets()) {
      if (set.getLanes().contains(movedLane)) {
        laneSet = set;
        break;
      }
    }

    if (laneSet != null) {
      laneSet.getLanes().remove(movedLane);
      if (laneSet.getLanes().isEmpty()) {
        sourceParticipant.getProcessRef().getLaneSets().remove(laneSet);
      }
    }

    if (toLane.getChildLaneSet() == null) {
      LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
//      createLaneSet.setId(EcoreUtil.generateUUID());
      toLane.setChildLaneSet(createLaneSet);
      ModelUtil.setID(createLaneSet);
    }
    toLane.getChildLaneSet().getLanes().add(movedLane);
  }
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    FeatureSupport.redraw(context.getSourceContainer());
    FeatureSupport.redraw(context.getTargetContainer());
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane movedLane = getMovedLane(context);
    Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());

    try {
      ModelHandler handler = ModelHandler.getInstance(getDiagram());
      handler.moveLane(movedLane, targetParticipant);
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    modifyModelStructure(context);
    FeatureSupport.redraw(context.getSourceContainer());
  }

  private void modifyModelStructure(IMoveShapeContext context) {
    Lane parentLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
    Lane movedLane = (Lane) getBusinessObjectForPictogramElement(context.getShape());
    parentLane.getChildLaneSet().getLanes().remove(movedLane);
    try {
      ModelHandler mh = ModelHandler.getInstance(getDiagram());
      mh.laneToTop(movedLane);
    } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.bpmn2.Lane

    super(fp);
  }

  @Override
  public boolean canMoveShape(IMoveShapeContext context) {
    Lane targetLane = getTargetLane(context);

    if (targetLane.getFlowNodeRefs() != null && targetLane.getFlowNodeRefs().size() > 0) {
      return false;
    }

    Lane movedLane = getMovedLane(context);

    if (targetLane.getChildLaneSet() != null && targetLane.getChildLaneSet().getLanes().contains(movedLane)) {
      return false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.