@Override protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { // Gather data objects List<ValuedDataObject> allDataObjects = new ArrayList<>(); allDataObjects.addAll(process.getDataObjects()); List<SubProcess> subProcesses = process.findFlowElementsOfType(SubProcess.class, true); for (SubProcess subProcess : subProcesses) { allDataObjects.addAll(subProcess.getDataObjects()); } // Validate for (ValuedDataObject dataObject : allDataObjects) { if (StringUtils.isEmpty(dataObject.getName())) { addError(errors, Problems.DATA_OBJECT_MISSING_NAME, process, dataObject, "Name is mandatory for a data object"); } } }
for (ValuedDataObject thisObject : getDataObjects()) { boolean exists = false; for (ValuedDataObject otherObject : otherElement.getDataObjects()) { if (thisObject.getId().equals(otherObject.getId())) { exists = true; if (otherElement.getDataObjects() != null && !otherElement.getDataObjects().isEmpty()) { for (ValuedDataObject dataObject : otherElement.getDataObjects()) { ValuedDataObject clone = dataObject.clone(); dataObjects.add(clone);
@Override public void execute(DelegateExecution execution) { SubProcess subProcess = getSubProcessFromExecution(execution); execution.setScope(true); // initialize the template-defined data objects as variables Map<String, Object> dataObjectVars = processDataObjects(subProcess.getDataObjects()); if (dataObjectVars != null) { execution.setVariablesLocal(dataObjectVars); } }
for (ValuedDataObject thisObject : getDataObjects()) { boolean exists = false; for (ValuedDataObject otherObject : otherElement.getDataObjects()) { if (thisObject.getId().equals(otherObject.getId())) { exists = true; if (otherElement.getDataObjects() != null && !otherElement.getDataObjects().isEmpty()) { for (ValuedDataObject dataObject : otherElement.getDataObjects()) { ValuedDataObject clone = dataObject.clone(); dataObjects.add(clone);
if (!activeSubProcessList.isEmpty()) { SubProcess subProcess = activeSubProcessList.get(activeSubProcessList.size() - 1); subProcess.getDataObjects().add((ValuedDataObject) parsedElement); } else { activeProcess.getDataObjects().add((ValuedDataObject) parsedElement);
@Override protected void convertElementToJson(ObjectNode propertiesNode, BaseElement baseElement) { SubProcess subProcess = (SubProcess) baseElement; propertiesNode.put("activitytype", getStencilId(baseElement)); GraphicInfo gi = model.getGraphicInfo(baseElement.getId()); Boolean isExpanded = gi.getExpanded(); ArrayNode subProcessShapesArrayNode = objectMapper.createArrayNode(); GraphicInfo graphicInfo = model.getGraphicInfo(subProcess.getId()); if (isExpanded != null && isExpanded == false) { processor.processFlowElements(subProcess, model, subProcessShapesArrayNode, formKeyMap, decisionTableKeyMap, 0, 0); } else { processor.processFlowElements(subProcess, model, subProcessShapesArrayNode, formKeyMap, decisionTableKeyMap, graphicInfo.getX(), graphicInfo.getY()); } flowElementNode.set("childShapes", subProcessShapesArrayNode); if (subProcess instanceof Transaction) { propertiesNode.put("istransaction", true); } BpmnJsonConverterUtil.convertDataPropertiesToJson(subProcess.getDataObjects(), propertiesNode); }
SubProcess subprocess = (SubProcess) flowElement; boolean isFlowElementLocalizationChanged = localizeFlowElements(subprocess.getFlowElements(), infoNode); boolean isDataObjectLocalizationChanged = localizeDataObjectElements(subprocess.getDataObjects(), infoNode); if (isFlowElementLocalizationChanged || isDataObjectLocalizationChanged) { localizationValuesChanged = true;
SubProcess subprocess = (SubProcess) flowElement; boolean isFlowElementLocalizationChanged = localizeFlowElements(subprocess.getFlowElements(), infoNode); boolean isDataObjectLocalizationChanged = localizeDataObjectElements(subprocess.getDataObjects(), infoNode); if (isFlowElementLocalizationChanged || isDataObjectLocalizationChanged) { localizationValuesChanged = true;
subProcessExecution.setVariablesLocal(processDataObjects(subProcess.getDataObjects()));
for (ValuedDataObject dataObject : subProcess.getDataObjects()) { if (dataObject.getName().equals(variableEntity.getName())) { foundDataObject = dataObject;
for (ValuedDataObject dataObject : subProcess.getDataObjects()) { if (dataObject.getName().equals(variableEntity.getName())) { foundDataObject = dataObject;
for (ValuedDataObject dataObjectDefinition : subProcess.getDataObjects()) { if (dataObjectDefinition.getName().equals(variableEntity.getName())) { foundDataObject = dataObjectDefinition;
@Override public void execute(DelegateExecution execution) { SubProcess subProcess = getSubProcessFromExecution(execution); FlowElement startElement = getStartElement(subProcess); if (startElement == null) { throw new FlowableException("No initial activity found for subprocess " + subProcess.getId()); } ExecutionEntity executionEntity = (ExecutionEntity) execution; executionEntity.setScope(true); ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(); // initialize the template-defined data objects as variables Map<String, Object> dataObjectVars = processDataObjects(subProcess.getDataObjects()); if (dataObjectVars != null) { executionEntity.setVariablesLocal(dataObjectVars); } CommandContext commandContext = Context.getCommandContext(); ProcessInstanceHelper processInstanceHelper = processEngineConfiguration.getProcessInstanceHelper(); processInstanceHelper.processAvailableEventSubProcesses(executionEntity, subProcess, commandContext); ExecutionEntity startSubProcessExecution = CommandContextUtil.getExecutionEntityManager(commandContext).createChildExecution(executionEntity); startSubProcessExecution.setCurrentFlowElement(startElement); CommandContextUtil.getAgenda().planContinueProcessOperation(startSubProcessExecution); }
for (ValuedDataObject dataObjectDefinition : subProcess.getDataObjects()) { if (dataObjectDefinition.getName().equals(variableEntity.getName())) { foundDataObject = dataObjectDefinition;
@Override protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) { ActivityImpl activity = createActivityOnScope(bpmnParse, subProcess, BpmnXMLConstants.ELEMENT_SUBPROCESS, bpmnParse.getCurrentScope()); activity.setAsync(subProcess.isAsynchronous()); activity.setExclusive(!subProcess.isNotExclusive()); boolean triggeredByEvent = false; if (subProcess instanceof EventSubProcess) { triggeredByEvent = true; } activity.setProperty("triggeredByEvent", triggeredByEvent); // event subprocesses are not scopes activity.setScope(!triggeredByEvent); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocActivityBehavior(subProcess)); bpmnParse.setCurrentScope(activity); bpmnParse.setCurrentSubProcess(subProcess); bpmnParse.processFlowElements(subProcess.getFlowElements()); processArtifacts(bpmnParse, subProcess.getArtifacts(), activity); // no data objects for event subprocesses if (!(subProcess instanceof EventSubProcess)) { // parse out any data objects from the template in order to set up the necessary process variables Map<String, Object> variables = processDataObjects(bpmnParse, subProcess.getDataObjects(), activity); activity.setVariables(variables); } bpmnParse.removeCurrentScope(); bpmnParse.removeCurrentSubProcess(); if (subProcess.getIoSpecification() != null) { IOSpecification ioSpecification = createIOSpecification(bpmnParse, subProcess.getIoSpecification()); activity.setIoSpecification(ioSpecification); } }