public void setCurrentFlowElement(FlowElement currentFlowElement) { this.currentFlowElement = currentFlowElement; if (currentFlowElement != null) { this.activityId = currentFlowElement.getId(); } else { this.activityId = null; } }
protected void internalPopulateExecutionTree(DebugInfoExecutionTreeNode parentNode, Map<String, List<ExecutionEntity>> parentMapping) { if (parentMapping.containsKey(parentNode.getId())) { for (ExecutionEntity childExecutionEntity : parentMapping.get(parentNode.getId())) { DebugInfoExecutionTreeNode childNode = new DebugInfoExecutionTreeNode(); childNode.setId(childExecutionEntity.getId()); childNode.setActivityId(childExecutionEntity.getCurrentFlowElement() != null ? childExecutionEntity.getCurrentFlowElement().getId() : null); childNode.setActivityName(childExecutionEntity.getCurrentFlowElement() != null ? childExecutionEntity.getCurrentFlowElement().getName() : null); childNode.setProcessDefinitionId(childExecutionEntity.getProcessDefinitionId()); childNode.setParentNode(childNode); parentNode.getChildNodes().add(childNode); internalPopulateExecutionTree(childNode, parentMapping); } } }
writeDefaultAttribute(ATTRIBUTE_ID, baseElement.getId(), xtw); if (baseElement instanceof FlowElement) { writeDefaultAttribute(ATTRIBUTE_NAME, ((FlowElement) baseElement).getName(), xtw); if (StringUtils.isNotEmpty(flowElement.getDocumentation())) { xtw.writeCharacters(flowElement.getDocumentation()); xtw.writeEndElement();
flowElement.setName(getPropertyValueAsString(PROPERTY_NAME, elementNode)); flowElement.setDocumentation(getPropertyValueAsString(PROPERTY_DOCUMENTATION, elementNode)); orderElement.setName("EDITOR_FLOW_ORDER"); orderElement.setElementText(orderNode.asText()); flowElement.addExtensionElement(orderElement); idExtensionElement.setName("EDITOR_RESOURCEID"); idExtensionElement.setElementText(elementNode.get(EDITOR_SHAPE_ID).asText()); flowElement.addExtensionElement(idExtensionElement); } else if (parentElement instanceof Lane) { Lane lane = (Lane) parentElement; lane.getFlowReferences().add(flowElement.getId()); lane.getParentProcess().addFlowElement(flowElement);
public ActivityImpl createActivityOnScope(BpmnParse bpmnParse, FlowElement flowElement, String xmlLocalName, ScopeImpl scopeElement) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Parsing activity {}", flowElement.getId()); } ActivityImpl activity = scopeElement.createActivity(flowElement.getId()); bpmnParse.setCurrentActivity(activity); activity.setProperty("name", flowElement.getName()); activity.setProperty("documentation", flowElement.getDocumentation()); if (flowElement instanceof Activity) { Activity modelActivity = (Activity) flowElement; activity.setProperty("default", modelActivity.getDefaultFlow()); if(modelActivity.isForCompensation()) { activity.setProperty(PROPERTYNAME_IS_FOR_COMPENSATION, true); } } else if (flowElement instanceof Gateway) { activity.setProperty("default", ((Gateway) flowElement).getDefaultFlow()); } activity.setProperty("type", xmlLocalName); return activity; }
if (StringUtils.isNotEmpty(flowElement.getName())) { propertiesNode.put(PROPERTY_NAME, flowElement.getName()); if (StringUtils.isNotEmpty(flowElement.getDocumentation())) { propertiesNode.put(PROPERTY_DOCUMENTATION, flowElement.getDocumentation()); BpmnJsonConverterUtil.convertListenersToJson(((FlowElement) baseElement).getExecutionListeners(), true, propertiesNode);
List<ExtensionElement> localizationElements = flowElement.getExtensionElements().get("localization"); if (localizationElements != null) { for (ExtensionElement localizationElement : localizationElements) { String flowElementId = flowElement.getId(); if (isEqualToCurrentLocalizationValue(locale, flowElementId,
if (flowElement != null && StringUtils.isNotEmpty(flowElement.getName())) { hasName = true;
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception { String docText = xtr.getElementText(); if (StringUtils.isNotEmpty(docText)) { if (parentElement instanceof FlowElement) { ((FlowElement) parentElement).setDocumentation(docText.trim()); } else if (parentElement instanceof Process) { ((Process) parentElement).setDocumentation(docText.trim()); } } } }
@Override protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { validateListeners(process, process, process.getExecutionListeners(), errors); for (FlowElement flowElement : process.getFlowElements()) { validateListeners(process, flowElement, flowElement.getExecutionListeners(), errors); } }
flowElement.setName(getPropertyValueAsString(PROPERTY_NAME, elementNode)); flowElement.setDocumentation(getPropertyValueAsString(PROPERTY_DOCUMENTATION, elementNode)); orderElement.setName("EDITOR_FLOW_ORDER"); orderElement.setElementText(orderNode.asText()); flowElement.addExtensionElement(orderElement); idExtensionElement.setName("EDITOR_RESOURCEID"); idExtensionElement.setElementText(elementNode.get(EDITOR_SHAPE_ID).asText()); flowElement.addExtensionElement(idExtensionElement); lane.getFlowReferences().add(flowElement.getId()); lane.getParentProcess().addFlowElement(flowElement);
if (StringUtils.isNotEmpty(flowElement.getName())) { propertiesNode.put(PROPERTY_NAME, flowElement.getName()); if (StringUtils.isNotEmpty(flowElement.getDocumentation())) { propertiesNode.put(PROPERTY_DOCUMENTATION, flowElement.getDocumentation()); BpmnJsonConverterUtil.convertListenersToJson(((FlowElement) baseElement).getExecutionListeners(), true, propertiesNode);
protected HistoricActivityInstanceEntity createHistoricActivityInstanceEntity(ExecutionEntity execution) { IdGenerator idGenerator = getProcessEngineConfiguration().getIdGenerator(); String processDefinitionId = execution.getProcessDefinitionId(); String processInstanceId = execution.getProcessInstanceId(); HistoricActivityInstanceEntity historicActivityInstance = getHistoricActivityInstanceEntityManager().create(); historicActivityInstance.setId(idGenerator.getNextId()); historicActivityInstance.setProcessDefinitionId(processDefinitionId); historicActivityInstance.setProcessInstanceId(processInstanceId); historicActivityInstance.setExecutionId(execution.getId()); historicActivityInstance.setActivityId(execution.getActivityId()); if (execution.getCurrentFlowElement() != null) { historicActivityInstance.setActivityName(execution.getCurrentFlowElement().getName()); historicActivityInstance.setActivityType(parseActivityType(execution.getCurrentFlowElement())); } Date now = getClock().getCurrentTime(); historicActivityInstance.setStartTime(now); // Inherit tenant id (if applicable) if (execution.getTenantId() != null) { historicActivityInstance.setTenantId(execution.getTenantId()); } getHistoricActivityInstanceEntityManager().insert(historicActivityInstance); return historicActivityInstance; }
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception { String docText = xtr.getElementText(); if (StringUtils.isNotEmpty(docText)) { if (parentElement instanceof FlowElement) { ((FlowElement) parentElement).setDocumentation(docText.trim()); } else if (parentElement instanceof Process) { ((Process) parentElement).setDocumentation(docText.trim()); } } } }
((FlowElement) element).getExecutionListeners().add(listener);
protected void dispatchActivityCancelled(DelegateExecution execution, FlowElement terminateEndEvent) { Context.getProcessEngineConfiguration() .getEventDispatcher() .dispatchEvent( ActivitiEventBuilder.createActivityCancelledEvent(execution.getCurrentFlowElement().getId(), execution.getCurrentFlowElement().getName(), execution.getId(), execution.getProcessInstanceId(), execution.getProcessDefinitionId(), parseActivityType((FlowNode) execution.getCurrentFlowElement()), terminateEndEvent)); }
writeDefaultAttribute(ATTRIBUTE_ID, baseElement.getId(), xtw); if (baseElement instanceof FlowElement) { writeDefaultAttribute(ATTRIBUTE_NAME, ((FlowElement) baseElement).getName(), xtw); if (StringUtils.isNotEmpty(flowElement.getDocumentation())) { xtw.writeCharacters(flowElement.getDocumentation()); xtw.writeEndElement();