Package org.eclipse.bpmn2

Examples of org.eclipse.bpmn2.BaseElement


    for (BPMNDiagram bpmnDiagram : BPMNDiagramList) {
      for (DiagramElement diagramElement : bpmnDiagram.getPlane().getPlaneElement()) {
        if (diagramElement instanceof BPMNShape) {
          BPMNShape bpmnShape = (BPMNShape) diagramElement;
          Map<String, Object>  positionMap=new HashMap<String, Object>();
          BaseElement bpmnElement=getBaseElement(bpmnShape.getBpmnElement());
          if(bpmnElement==null){
            continue;
          }
          //判断如果是折叠起来的子流程,则将其所有的子元素的坐标替换成父元素的
          if(bpmnElement instanceof SubProcess){
            if(bpmnShape.isIsExpanded() == false){
              List<String> excludeNodeIds = null;
              excludeNodeIds = getExcluesElement((SubProcess)bpmnElement);
              tmpMap.put(bpmnElement.getId(), excludeNodeIds);
            }
          }
          float x=bpmnShape.getBounds().getX();
          float y=bpmnShape.getBounds().getY();
          float height=bpmnShape.getBounds().getHeight();
          float width=bpmnShape.getBounds().getWidth();
          //height,width,x,y
          positionMap.put("x",x);
          positionMap.put("y",y);
          positionMap.put("height",height);
          positionMap.put("width",width);
          positionInfo.put(bpmnElement.getId(), positionMap);
        }
        if (diagramElement instanceof BPMNEdge) {
          //BPMNEdge bpmnEdge = (BPMNEdge) diagramElement;
        }
       
View Full Code Here


    }
    if(baseElement.getId()==null){
      BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
      if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
        String elementId=basicEObjectImpl.eProxyURI().fragment();
        BaseElement bpmnElement=definitions.getElement(elementId);
        return bpmnElement;
      }
      else{
        return null;
      }
View Full Code Here

    for(DiagramElement diagram :  bpmnModel.getDiagrams().get(0).getPlane().getPlaneElement()){
      if(diagram instanceof BPMNShape){
        BPMNShape bpmnShape = (BPMNShape)diagram;
        String shapeId = bpmnShape.getId();
        String elementId = BpmnJsonConverterUtil.getElementIdFromShapeId(shapeId);
        BaseElement bpmnElement = BpmnModelUtil.getElement(bpmnModel,elementId,BaseElement.class);
        bpmnShape.setBpmnElement(bpmnElement);
      }
    }
    //生成线条元素
    readEdgeDI(edgeMap, sourceAndTargetMap, bpmnModel);
View Full Code Here

        tokenEntity.signal();
      }
     
    }
    else{
      BaseElement baseElement=processDefinition.getDefinitions().getElement(nodeId);
      if(baseElement instanceof BoundaryEvent){
        BoundaryEvent boundaryEvent=(BoundaryEvent)baseElement;
        Activity activity =boundaryEvent.getAttachedToRef();
       
        //String nodeTokenId = this.getId();
View Full Code Here

              minX=bpmnShape.getBounds().getX();
           
            }
          }
         
          BaseElement bpmnElement=getBaseElement(bpmnShape.getBpmnElement());
       
         
         
          if(bpmnElement==null){
            continue;
          }
         
       
         
          if (bpmnElement instanceof StartEvent) {
           
            String startEventSVG = startEventToSVG(bpmnShape);
            svg.addChildren(startEventSVG);

          }
          if (bpmnElement instanceof EndEvent) {
            String endEventSVG = endEventToSVG(bpmnShape);
            svg.addChildren(endEventSVG);

          }
         
          if (bpmnElement instanceof IntermediateCatchEventBehavior) {
            String intermediateTimerEventSVG = intermediateTimerEventToSVG(bpmnShape);
            svg.addChildren(intermediateTimerEventSVG);
           
          }
         

          if (bpmnElement instanceof Task) {

            String taskSVG = taskToSVG(bpmnShape);
            svg.addChildren(taskSVG);

          }
         
          if (bpmnElement instanceof CallActivity) {

            String taskSVG = callActivityToSVG(bpmnShape);
            svg.addChildren(taskSVG);

          }

          if (bpmnElement instanceof Gateway) {
            String gatewaySVG = gatewayToSVG(bpmnShape);
            svg.addChildren(gatewaySVG);
          }
         
          if(bpmnElement instanceof Lane)
          {
            String laneSVG = laneToSVG(bpmnShape);
            svg.addChildren(laneSVG);
          }
         
          if(bpmnElement instanceof Participant)
          {
            String laneSVG = participantToSVG(bpmnShape);
            svg.addChildren(laneSVG);
          }
         
         
         
          if(bpmnElement instanceof SubProcess)
          {
            String subProcessSVG = subProcessToSVG(bpmnShape);
            svg.addChildren(subProcessSVG);
          }
          if(bpmnElement instanceof Group)
          {
            String subProcessSVG = groupToSVG(bpmnShape,bpmnElement);
            svg.addChildren(subProcessSVG);
          }
          if(bpmnElement instanceof DataObject)
          {
            String dataObjectSVG= dataObjectToSVG(bpmnShape,bpmnElement);
            svg.addChildren(dataObjectSVG);
          }
          //DataStoreReference  //DataInput  //DataOutput  //Message
          if(bpmnElement instanceof DataStoreReference)
          {
            String dataStoreReferenceSVG= dataStoreReferenceToSVG(bpmnShape,bpmnElement);
            svg.addChildren(dataStoreReferenceSVG);
          }
          if(bpmnElement instanceof DataInput)
          {
            String dataInputSVG= dataInputToSVG(bpmnShape,bpmnElement);
            svg.addChildren(dataInputSVG);
          }
          if(bpmnElement instanceof DataOutput)
          {
            String dataOutputSVG= dataOutputToSVG(bpmnShape,bpmnElement);
            svg.addChildren(dataOutputSVG);
          }
          if(bpmnElement instanceof Message)
          {
            String messageSVG= messageToSVG(bpmnShape,bpmnElement);
            svg.addChildren(messageSVG);
          }
         
         
          if(bpmnElement instanceof TextAnnotation)
          {
            String messageSVG= textAnnotationToSVG(bpmnShape,bpmnElement);
            svg.addChildren(messageSVG);
          }
         
         
          if(bpmnElement instanceof BoundaryEvent)
          {
            String messageSVG= boundaryEventToSVG(bpmnShape,bpmnElement);
            svg.addChildren(messageSVG);
          }
         
         
         
         
        }
        if (diagramElement instanceof BPMNEdge) {
          BPMNEdge bpmnEdge = (BPMNEdge) diagramElement;
         
          List<Point> pointList = bpmnEdge.getWaypoint();
          for (Point point : pointList) {
           
           
            if(point.getX()>maxX)
            {
              maxX=point.getX();
           
            }
            if(point.getY()>maxY)
            {
              maxY=point.getY();
            }
 
          }
          BaseElement bpmnElement=getBaseElement(bpmnEdge.getBpmnElement());
          if (bpmnElement instanceof SequenceFlow) {
            String sequenceFlowSVG = sequenceFlowToSVG(bpmnEdge);
            svg.addEdge(sequenceFlowSVG);
          }
          if (bpmnElement instanceof Association) {
View Full Code Here

   
    if(baseElement.getId()==null){
      BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
      if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
        String elementId=basicEObjectImpl.eProxyURI().fragment();
        BaseElement bpmnElement=definitions.getElement(elementId);
        return bpmnElement;
      }
      else{
        return null;
      }
View Full Code Here

  public static BPMNShape getBpmnShape(Definitions definitions,String elementId){
    List<DiagramElement> diagramElements=definitions.getDiagrams().get(0).getPlane().getPlaneElement();
    for (DiagramElement diagramElement : diagramElements) {
      if(diagramElement instanceof BPMNShape){
        BPMNShape bpmnShape = (BPMNShape) diagramElement;
        BaseElement bpmnElement=getBaseElement((DefinitionsBehavior)definitions,bpmnShape.getBpmnElement());
        if(bpmnElement==null){
          continue;
        }
        if(elementId.equals(bpmnElement.getId())){
          return bpmnShape;
        }
      }
    }
    return null;
View Full Code Here

    }
    if(baseElement.getId()==null){
      BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
      if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
        String elementId=basicEObjectImpl.eProxyURI().fragment();
        BaseElement bpmnElement=definitions.getElement(elementId);
        return bpmnElement;
      }
      else{
        return null;
      }
View Full Code Here

        if (diagramElement instanceof BPMNShape) {
          BPMNShapeImpl bpmnShape = (BPMNShapeImpl) diagramElement;
          org.eclipse.emf.ecore.impl.BasicEObjectImpl sssBaseElementImpl=(org.eclipse.emf.ecore.impl.BasicEObjectImpl)bpmnShape.getBpmnElement();
         
          String idString=sssBaseElementImpl.eProxyURI().fragment();
          BaseElement dd=((DefinitionsBehavior)myWeb).getElement(idString);
         
          if (bpmnShape.getBounds().getX() + bpmnShape.getBounds().getWidth() > maxX) {
            maxX = bpmnShape.getBounds().getX() + bpmnShape.getBounds().getWidth();

          }
View Full Code Here

    //救活它。。
    token.setEndTime(null);
    //获取流程定义
    ProcessDefinitionBehavior processDefinition=processInstance.getProcessDefinition();
    //获取指定的节点
    BaseElement baseElement=processDefinition.getDefinitions().getElement(nodeId);
    if(baseElement instanceof FlowNode){
     
      FlowNode flowNode= (FlowNode)baseElement;
      ExecutionContext executionContext=ProcessObjectFactory.FACTORYINSTANCE.createExecutionContext(token);
      //让令牌进入节点开始走流程
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.BaseElement

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.