org.activiti.bpmn.model.Process.getFlowElements()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(560)

本文整理了Java中org.activiti.bpmn.model.Process.getFlowElements()方法的一些代码示例,展示了Process.getFlowElements()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Process.getFlowElements()方法的具体详情如下:
包路径:org.activiti.bpmn.model.Process
类名称:Process
方法名:getFlowElements

Process.getFlowElements介绍

暂无

代码示例

代码示例来源:origin: Activiti/Activiti

  1. /**
  2. * Since subprocesses are autolayouted independently (see {@link #handleSubProcess(FlowElement)}), the elements have x and y coordinates relative to the bounds of the subprocess (thinking the
  3. * subprocess is on (0,0). This however, does not work for nested subprocesses, as they need to take in account the x and y coordinates for each of the parent subproceses.
  4. *
  5. * This method is to be called after fully layouting one process, since ALL elements need to have x and y.
  6. */
  7. protected void translateNestedSubprocesses(Process process) {
  8. for (FlowElement flowElement : process.getFlowElements()) {
  9. if (flowElement instanceof SubProcess) {
  10. translateNestedSubprocessElements((SubProcess) flowElement);
  11. }
  12. }
  13. }

代码示例来源:origin: Activiti/Activiti

  1. @Override
  2. protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) {
  3. for (FlowElement flowElement : process.getFlowElements()) {
  4. if (flowElement instanceof Activity) {
  5. Activity activity = (Activity) flowElement;
  6. handleConstraints(process, activity, errors);
  7. handleMultiInstanceLoopCharacteristics(process, activity, errors);
  8. handleDataAssociations(process, activity, errors);
  9. }
  10. }
  11. }

代码示例来源:origin: Activiti/Activiti

  1. protected void addMessageEventSubscriptions(ProcessDefinitionEntity processDefinition,
  2. Process process,
  3. BpmnModel bpmnModel) {
  4. if (CollectionUtil.isNotEmpty(process.getFlowElements())) {
  5. for (FlowElement element : process.getFlowElements()) {
  6. if (element instanceof StartEvent) {
  7. StartEvent startEvent = (StartEvent) element;
  8. if (CollectionUtil.isNotEmpty(startEvent.getEventDefinitions())) {
  9. EventDefinition eventDefinition = startEvent.getEventDefinitions().get(0);
  10. if (eventDefinition instanceof MessageEventDefinition) {
  11. MessageEventDefinition messageEventDefinition = (MessageEventDefinition) eventDefinition;
  12. insertMessageEvent(messageEventDefinition,
  13. startEvent,
  14. processDefinition,
  15. bpmnModel);
  16. }
  17. }
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: Activiti/Activiti

  1. @Override
  2. protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) {
  3. validateListeners(process, process, process.getExecutionListeners(), errors);
  4. for (FlowElement flowElement : process.getFlowElements()) {
  5. validateListeners(process, flowElement, flowElement.getExecutionListeners(), errors);
  6. }
  7. }

代码示例来源:origin: Activiti/Activiti

  1. Collection<FlowElement> flowElements = model.getMainProcess().getFlowElements();
  2. Map<String, GraphicInfo> locations = new HashMap<String, GraphicInfo>();
  3. Map<String, List<GraphicInfo>> flowLocations = new HashMap<String, List<GraphicInfo>>();

代码示例来源:origin: Activiti/Activiti

  1. if (process.getFlowElements().isEmpty() && process.getLanes().isEmpty()) {
  2. for (FlowElement flowElement : process.getFlowElements()) {
  3. createXML(flowElement, model, xtw);

代码示例来源:origin: Activiti/Activiti

  1. newMainProcess.getFlowElements().addAll(subFlowElements);
  2. newMainProcess.getArtifacts().addAll(((SubProcess)subElement).getArtifacts());
  3. subModel.addProcess(newMainProcess);

代码示例来源:origin: Activiti/Activiti

  1. processFlowElements(process.getFlowElements(), process);

代码示例来源:origin: Activiti/Activiti

  1. if (process.getFlowElements().isEmpty() && process.getLanes().isEmpty()) {
  2. for (FlowElement flowElement : process.getFlowElements()) {
  3. createXML(flowElement, model, xtw);

代码示例来源:origin: Activiti/Activiti

  1. public void parse(XMLStreamReader xtr, BpmnModel model) throws Exception {
  2. String resourceId = xtr.getAttributeValue(null, ATTRIBUTE_ID);
  3. String resourceName = xtr.getAttributeValue(null, ATTRIBUTE_NAME);
  4. Resource resource;
  5. if (model.containsResourceId(resourceId)) {
  6. resource = model.getResource(resourceId);
  7. resource.setName(resourceName);
  8. for (org.activiti.bpmn.model.Process process : model.getProcesses()) {
  9. for (FlowElement fe : process.getFlowElements()) {
  10. if (fe instanceof UserTask
  11. && ((UserTask) fe).getCandidateGroups().contains(resourceId)) {
  12. ((UserTask) fe).getCandidateGroups().remove(resourceId);
  13. ((UserTask) fe).getCandidateGroups().add(resourceName);
  14. }
  15. }
  16. }
  17. } else {
  18. resource = new Resource(resourceId, resourceName);
  19. model.addResource(resource);
  20. }
  21. BpmnXMLUtil.addXMLLocation(resource, xtr);
  22. }
  23. }

代码示例来源:origin: Activiti/Activiti

  1. protected List<TimerJobEntity> getTimerDeclarations(ProcessDefinitionEntity processDefinition, Process process) {
  2. JobManager jobManager = Context.getCommandContext().getJobManager();
  3. List<TimerJobEntity> timers = new ArrayList<TimerJobEntity>();
  4. if (CollectionUtil.isNotEmpty(process.getFlowElements())) {
  5. for (FlowElement element : process.getFlowElements()) {
  6. if (element instanceof StartEvent) {
  7. StartEvent startEvent = (StartEvent) element;

代码示例来源:origin: Activiti/Activiti

  1. process);
  2. process.setDataObjects(dataObjects);
  3. process.getFlowElements().addAll(dataObjects);
  4. process.getFlowElements(),
  5. edgeMap,
  6. bpmnModel,

代码示例来源:origin: Activiti/Activiti

  1. public ProcessInstance createAndStartProcessInstanceByMessage(ProcessDefinition processDefinition, String messageName,
  2. Map<String, Object> variables, Map<String, Object> transientVariables) {
  3. CommandContext commandContext = Context.getCommandContext();
  4. // Do not start process a process instance if the process definition is suspended
  5. if (ProcessDefinitionUtil.isProcessDefinitionSuspended(processDefinition.getId())) {
  6. throw new ActivitiException("Cannot start process instance. Process definition " + processDefinition.getName() + " (id = " + processDefinition.getId() + ") is suspended");
  7. }
  8. // Get model from cache
  9. Process process = ProcessDefinitionUtil.getProcess(processDefinition.getId());
  10. if (process == null) {
  11. throw new ActivitiException("Cannot start process instance. Process model " + processDefinition.getName() + " (id = " + processDefinition.getId() + ") could not be found");
  12. }
  13. FlowElement initialFlowElement = null;
  14. for (FlowElement flowElement : process.getFlowElements()) {
  15. if (flowElement instanceof StartEvent) {
  16. StartEvent startEvent = (StartEvent) flowElement;
  17. if (CollectionUtil.isNotEmpty(startEvent.getEventDefinitions()) && startEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) {
  18. MessageEventDefinition messageEventDefinition = (MessageEventDefinition) startEvent.getEventDefinitions().get(0);
  19. if (messageEventDefinition.getMessageRef().equals(messageName)) {
  20. initialFlowElement = flowElement;
  21. break;
  22. }
  23. }
  24. }
  25. }
  26. if (initialFlowElement == null) {
  27. throw new ActivitiException("No message start event found for process definition " + processDefinition.getId() + " and message name " + messageName);
  28. }
  29. return createAndStartProcessInstanceWithInitialFlowElement(processDefinition, null, null, initialFlowElement, process, variables, transientVariables, true);
  30. }

代码示例来源:origin: Activiti/Activiti

  1. for (FlowElement flowElement : process.getFlowElements()) {

代码示例来源:origin: Activiti/Activiti

  1. boolean isFlowElementLocalizationChanged = localizeFlowElements(process.getFlowElements(),
  2. infoNode);
  3. boolean isDataObjectLocalizationChanged = localizeDataObjectElements(process.getDataObjects(),

代码示例来源:origin: Activiti/Activiti

  1. if (CollectionUtil.isNotEmpty(previousProcess.getFlowElements())) {

代码示例来源:origin: Activiti/Activiti

  1. Process process,
  2. BpmnModel bpmnModel) {
  3. if (CollectionUtil.isNotEmpty(process.getFlowElements())) {
  4. for (FlowElement element : process.getFlowElements()) {
  5. if (element instanceof StartEvent) {
  6. StartEvent startEvent = (StartEvent) element;

代码示例来源:origin: Activiti/Activiti

  1. protected ProcessDefinitionEntity transformProcess(BpmnParse bpmnParse, Process process) {
  2. ProcessDefinitionEntity currentProcessDefinition = Context.getCommandContext().getProcessDefinitionEntityManager().create();
  3. bpmnParse.setCurrentProcessDefinition(currentProcessDefinition);
  4. /*
  5. * Mapping object model - bpmn xml: processDefinition.id -> generated by activiti engine processDefinition.key -> bpmn id (required) processDefinition.name -> bpmn name (optional)
  6. */
  7. currentProcessDefinition.setKey(process.getId());
  8. currentProcessDefinition.setName(process.getName());
  9. currentProcessDefinition.setCategory(bpmnParse.getBpmnModel().getTargetNamespace());
  10. currentProcessDefinition.setDescription(process.getDocumentation());
  11. currentProcessDefinition.setDeploymentId(bpmnParse.getDeployment().getId());
  12. if (bpmnParse.getDeployment().getEngineVersion() != null) {
  13. currentProcessDefinition.setEngineVersion(bpmnParse.getDeployment().getEngineVersion());
  14. }
  15. createEventListeners(bpmnParse, process.getEventListeners());
  16. if (LOGGER.isDebugEnabled()) {
  17. LOGGER.debug("Parsing process {}", currentProcessDefinition.getKey());
  18. }
  19. bpmnParse.processFlowElements(process.getFlowElements());
  20. processArtifacts(bpmnParse, process.getArtifacts());
  21. return currentProcessDefinition;
  22. }

代码示例来源:origin: Activiti/Activiti

  1. for (FlowElement flowElement : process.getFlowElements()) {
  2. if (flowElement instanceof EventSubProcess) {
  3. EventSubProcess eventSubProcess = (EventSubProcess) flowElement;

代码示例来源:origin: org.activiti/activiti-process-validation

  1. @Override
  2. protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) {
  3. validateListeners(process, process, process.getExecutionListeners(), errors);
  4. for (FlowElement flowElement : process.getFlowElements()) {
  5. validateListeners(process, flowElement, flowElement.getExecutionListeners(), errors);
  6. }
  7. }

相关文章