当前位置: 首页>>代码示例>>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;未经允许,请勿转载。