當前位置: 首頁>>代碼示例>>Java>>正文


Java FlowNode類代碼示例

本文整理匯總了Java中org.activiti.bpmn.model.FlowNode的典型用法代碼示例。如果您正苦於以下問題:Java FlowNode類的具體用法?Java FlowNode怎麽用?Java FlowNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FlowNode類屬於org.activiti.bpmn.model包,在下文中一共展示了FlowNode類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: gatherAllFlowNodes

import org.activiti.bpmn.model.FlowNode; //導入依賴的package包/類
protected static List<FlowNode> gatherAllFlowNodes(
        FlowElementsContainer flowElementsContainer) {
    List<FlowNode> flowNodes = new ArrayList<FlowNode>();

    for (FlowElement flowElement : flowElementsContainer.getFlowElements()) {
        if (flowElement instanceof FlowNode) {
            flowNodes.add((FlowNode) flowElement);
        }

        if (flowElement instanceof FlowElementsContainer) {
            flowNodes
                    .addAll(gatherAllFlowNodes((FlowElementsContainer) flowElement));
        }
    }

    return flowNodes;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:18,代碼來源:CustomProcessDiagramGenerator.java

示例2: draw

import org.activiti.bpmn.model.FlowNode; //導入依賴的package包/類
public void draw(ProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode) {
  GraphicInfo graphicInfo = bpmnModel.getGraphicInfo(flowNode.getId());
  BoundaryEvent boundaryEvent = (BoundaryEvent) flowNode;
  if (boundaryEvent.getEventDefinitions() != null && boundaryEvent.getEventDefinitions().size() > 0) {
    if (boundaryEvent.getEventDefinitions().get(0) instanceof TimerEventDefinition) {
      
      processDiagramCanvas.drawCatchingTimerEvent(flowNode.getName(), (int) graphicInfo.getX(), 
              (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight(), boundaryEvent.isCancelActivity());
      
    } else if (boundaryEvent.getEventDefinitions().get(0) instanceof ErrorEventDefinition) {
      
      processDiagramCanvas.drawCatchingErrorEvent((int) graphicInfo.getX(), (int) graphicInfo.getY(),
              (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight(), boundaryEvent.isCancelActivity());
      
    } else if (boundaryEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition) {
      processDiagramCanvas.drawCatchingSignalEvent(flowNode.getName(), (int) graphicInfo.getX(), 
              (int) graphicInfo.getY(), (int) graphicInfo.getWidth(), (int) graphicInfo.getHeight(), boundaryEvent.isCancelActivity());
    }
  }
  
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:22,代碼來源:ProcessDiagramGenerator.java

示例3: processFlowElements

import org.activiti.bpmn.model.FlowNode; //導入依賴的package包/類
private void processFlowElements(Collection<FlowElement> flowElementList, BaseElement parentScope) {
  for (FlowElement flowElement : flowElementList) {
 	  if (flowElement instanceof SequenceFlow) {
       SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
       FlowNode sourceNode = getFlowNodeFromScope(sequenceFlow.getSourceRef(), parentScope);
       if (sourceNode != null) {
         sourceNode.getOutgoingFlows().add(sequenceFlow);
       }
       FlowNode targetNode = getFlowNodeFromScope(sequenceFlow.getTargetRef(), parentScope);
       if (targetNode != null) {
         targetNode.getIncomingFlows().add(sequenceFlow);
       }
     } else if (flowElement instanceof BoundaryEvent) {
       BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
       FlowElement attachedToElement = getFlowNodeFromScope(boundaryEvent.getAttachedToRefId(), parentScope);
       if(attachedToElement != null) {
         boundaryEvent.setAttachedToRef((Activity) attachedToElement);
         ((Activity) attachedToElement).getBoundaryEvents().add(boundaryEvent);
       }
     } else if(flowElement instanceof SubProcess) {
       SubProcess subProcess = (SubProcess) flowElement;
       processFlowElements(subProcess.getFlowElements(), subProcess);
     }
  }
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:26,代碼來源:BpmnXMLConverter.java

示例4: gatherAllFlowNodes

import org.activiti.bpmn.model.FlowNode; //導入依賴的package包/類
protected static List<FlowNode> gatherAllFlowNodes(BpmnModel bpmnModel) {
  List<FlowNode> flowNodes = new ArrayList<FlowNode>();
  for (Process process : bpmnModel.getProcesses()) {
    flowNodes.addAll(gatherAllFlowNodes(process));
  }
  return flowNodes;
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:8,代碼來源:ProcessDiagramGenerator.java

示例5: convertNodeDto

import org.activiti.bpmn.model.FlowNode; //導入依賴的package包/類
public NodeDTO convertNodeDto(GraphicInfo graphicInfo,
        FlowElement flowElement, String id, BpmnModel bpmnModel) {
    NodeDTO nodeDto = new NodeDTO();
    nodeDto.setX((int) graphicInfo.getX());
    nodeDto.setY((int) graphicInfo.getY());
    nodeDto.setWidth((int) graphicInfo.getWidth());
    nodeDto.setHeight((int) graphicInfo.getHeight());
    //
    nodeDto.setId(id);
    nodeDto.setName(flowElement.getName());

    if (flowElement instanceof UserTask) {
        nodeDto.setType("用戶任務");

        UserTask userTask = (UserTask) flowElement;
        nodeDto.setAssignee(userTask.getAssignee());
    } else if (flowElement instanceof StartEvent) {
        nodeDto.setType("開始事件");
    } else if (flowElement instanceof EndEvent) {
        nodeDto.setType("結束事件");
    } else if (flowElement instanceof ExclusiveGateway) {
        nodeDto.setType("選擇網關");
    }

    if (flowElement instanceof FlowNode) {
        FlowNode flowNode = (FlowNode) flowElement;

        for (SequenceFlow sequenceFlow : flowNode.getOutgoingFlows()) {
            EdgeDTO edgeDto = new EdgeDTO();
            edgeDto.setId(sequenceFlow.getTargetRef());

            for (GraphicInfo flowGraphicInfo : bpmnModel
                    .getFlowLocationGraphicInfo(sequenceFlow.getId())) {
                List<Integer> position = new ArrayList<Integer>();
                position.add((int) flowGraphicInfo.getX()
                        - ((int) graphicInfo.getWidth() / 2));
                position.add((int) flowGraphicInfo.getY()
                        - ((int) graphicInfo.getHeight() / 2));
                edgeDto.getG().add(position);
            }

            edgeDto.getG().remove(0);
            edgeDto.getG().remove(edgeDto.getG().size() - 1);
            logger.debug("{}", edgeDto.getG());
            nodeDto.getOutgoings().add(edgeDto);
        }
    }

    return nodeDto;
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:51,代碼來源:TraceService.java

示例6: parse

import org.activiti.bpmn.model.FlowNode; //導入依賴的package包/類
@Override
public void parse(BpmnParse bpmnParse, BaseElement element) {
  super.parse(bpmnParse, element);
  createExecutionListenersOnScope(bpmnParse, ((FlowNode) element).getExecutionListeners(), findActivity(bpmnParse, element.getId()));
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:6,代碼來源:AbstractFlowNodeBpmnParseHandler.java


注:本文中的org.activiti.bpmn.model.FlowNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。