Java Code Examples for org.flowable.bpmn.model.Process#getId()
The following examples show how to use
org.flowable.bpmn.model.Process#getId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CamelBehavior.java From flowable-engine with Apache License 2.0 | 5 votes |
protected String getProcessDefinitionKey(DelegateExecution execution, boolean isV5Execution) { Process process = null; if (isV5Execution) { process = Flowable5CompatibilityContext.getFallbackFlowable5CompatibilityHandler().getProcessDefinitionProcessObject(execution.getProcessDefinitionId()); } else { process = ProcessDefinitionUtil.getProcess(execution.getProcessDefinitionId()); } return process.getId(); }
Example 2
Source File: GetProcessOnDefinitionInitializedListener.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void entityInitialized(FlowableEngineEntityEvent event) { if (event.getEntity() instanceof ProcessDefinitionEntity) { Process process = ProcessDefinitionUtil.getProcess(((ProcessDefinitionEntity) event.getEntity()).getId()); processId = process.getId(); } }
Example 3
Source File: BpmnModelValidator.java From flowable-engine with Apache License 2.0 | 5 votes |
protected void handleProcessConstraints(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { if (process.getId() != null && process.getId().length() > Constraints.PROCESS_DEFINITION_ID_MAX_LENGTH) { addError(errors, Problems.PROCESS_DEFINITION_ID_TOO_LONG, process, "The id of the process definition must not contain more than " + Constraints.PROCESS_DEFINITION_ID_MAX_LENGTH + " characters"); } if (process.getName() != null && process.getName().length() > Constraints.PROCESS_DEFINITION_NAME_MAX_LENGTH) { addError(errors, Problems.PROCESS_DEFINITION_NAME_TOO_LONG, process, "The name of the process definition must not contain more than " + Constraints.PROCESS_DEFINITION_NAME_MAX_LENGTH + " characters"); } if (process.getDocumentation() != null && process.getDocumentation().length() > Constraints.PROCESS_DEFINITION_DOCUMENTATION_MAX_LENGTH) { addError(errors, Problems.PROCESS_DEFINITION_DOCUMENTATION_TOO_LONG, process, "The documentation of the process definition must not contain more than " + Constraints.PROCESS_DEFINITION_DOCUMENTATION_MAX_LENGTH + " characters"); } }
Example 4
Source File: BpmnDeployer.java From flowable-engine with Apache License 2.0 | 4 votes |
protected void createLocalizationValues(String processDefinitionId, Process process) { if (process == null) return; CommandContext commandContext = Context.getCommandContext(); DynamicBpmnService dynamicBpmnService = CommandContextUtil.getProcessEngineConfiguration(commandContext).getDynamicBpmnService(); ObjectNode infoNode = dynamicBpmnService.getProcessDefinitionInfo(processDefinitionId); boolean localizationValuesChanged = false; List<ExtensionElement> localizationElements = process.getExtensionElements().get("localization"); if (localizationElements != null) { for (ExtensionElement localizationElement : localizationElements) { if (BpmnXMLConstants.FLOWABLE_EXTENSIONS_PREFIX.equals(localizationElement.getNamespacePrefix()) || BpmnXMLConstants.ACTIVITI_EXTENSIONS_PREFIX.equals(localizationElement.getNamespacePrefix())) { String locale = localizationElement.getAttributeValue(null, "locale"); String name = localizationElement.getAttributeValue(null, "name"); String documentation = null; List<ExtensionElement> documentationElements = localizationElement.getChildElements().get("documentation"); if (documentationElements != null) { for (ExtensionElement documentationElement : documentationElements) { documentation = StringUtils.trimToNull(documentationElement.getElementText()); break; } } String processId = process.getId(); if (!isEqualToCurrentLocalizationValue(locale, processId, "name", name, infoNode)) { dynamicBpmnService.changeLocalizationName(locale, processId, name, infoNode); localizationValuesChanged = true; } if (documentation != null && !isEqualToCurrentLocalizationValue(locale, processId, "description", documentation, infoNode)) { dynamicBpmnService.changeLocalizationDescription(locale, processId, documentation, infoNode); localizationValuesChanged = true; } } } } boolean isFlowElementLocalizationChanged = localizeFlowElements(process.getFlowElements(), infoNode); boolean isDataObjectLocalizationChanged = localizeDataObjectElements(process.getDataObjects(), infoNode); if (isFlowElementLocalizationChanged || isDataObjectLocalizationChanged) { localizationValuesChanged = true; } if (localizationValuesChanged) { dynamicBpmnService.saveProcessDefinitionInfo(processDefinitionId, infoNode); } }
Example 5
Source File: BpmnDeployer.java From flowable-engine with Apache License 2.0 | 4 votes |
protected void createLocalizationValues(String processDefinitionId, Process process) { if (process == null) return; CommandContext commandContext = Context.getCommandContext(); DynamicBpmnService dynamicBpmnService = commandContext.getProcessEngineConfiguration().getDynamicBpmnService(); ObjectNode infoNode = dynamicBpmnService.getProcessDefinitionInfo(processDefinitionId); boolean localizationValuesChanged = false; List<ExtensionElement> localizationElements = process.getExtensionElements().get("localization"); if (localizationElements != null) { for (ExtensionElement localizationElement : localizationElements) { if (BpmnXMLConstants.FLOWABLE_EXTENSIONS_PREFIX.equals(localizationElement.getNamespacePrefix()) || BpmnXMLConstants.ACTIVITI_EXTENSIONS_PREFIX.equals(localizationElement.getNamespacePrefix())) { String locale = localizationElement.getAttributeValue(null, "locale"); String name = localizationElement.getAttributeValue(null, "name"); String documentation = null; List<ExtensionElement> documentationElements = localizationElement.getChildElements().get("documentation"); if (documentationElements != null) { for (ExtensionElement documentationElement : documentationElements) { documentation = StringUtils.trimToNull(documentationElement.getElementText()); break; } } String processId = process.getId(); if (!isEqualToCurrentLocalizationValue(locale, processId, "name", name, infoNode)) { dynamicBpmnService.changeLocalizationName(locale, processId, name, infoNode); localizationValuesChanged = true; } if (documentation != null && !isEqualToCurrentLocalizationValue(locale, processId, "description", documentation, infoNode)) { dynamicBpmnService.changeLocalizationDescription(locale, processId, documentation, infoNode); localizationValuesChanged = true; } } } } boolean isFlowElementLocalizationChanged = localizeFlowElements(process.getFlowElements(), infoNode); boolean isDataObjectLocalizationChanged = localizeDataObjectElements(process.getDataObjects(), infoNode); if (isFlowElementLocalizationChanged || isDataObjectLocalizationChanged) { localizationValuesChanged = true; } if (localizationValuesChanged) { dynamicBpmnService.saveProcessDefinitionInfo(processDefinitionId, infoNode); } }