Class ResourceNameUtil
- java.lang.Object
-
- org.activiti.engine.impl.bpmn.deployer.ResourceNameUtil
-
public class ResourceNameUtil extends java.lang.ObjectStatic methods for working with BPMN and image resource names.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]BPMN_RESOURCE_SUFFIXESstatic java.lang.String[]DIAGRAM_SUFFIXES
-
Constructor Summary
Constructors Constructor Description ResourceNameUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetProcessDiagramResourceName(java.lang.String bpmnFileResource, java.lang.String processKey, java.lang.String diagramSuffix)static java.lang.StringgetProcessDiagramResourceNameFromDeployment(ProcessDefinitionEntity processDefinition, java.util.Map<java.lang.String,ResourceEntity> resources)Finds the name of a resource for the diagram for a process definition.static java.lang.StringstripBpmnFileSuffix(java.lang.String bpmnFileResource)
-
-
-
Method Detail
-
stripBpmnFileSuffix
public static java.lang.String stripBpmnFileSuffix(java.lang.String bpmnFileResource)
-
getProcessDiagramResourceName
public static java.lang.String getProcessDiagramResourceName(java.lang.String bpmnFileResource, java.lang.String processKey, java.lang.String diagramSuffix)
-
getProcessDiagramResourceNameFromDeployment
public static java.lang.String getProcessDiagramResourceNameFromDeployment(ProcessDefinitionEntity processDefinition, java.util.Map<java.lang.String,ResourceEntity> resources)
Finds the name of a resource for the diagram for a process definition. Assumes that the process definition's key and (BPMN) resource name are already set.It will first look for an image resource which matches the process specifically, before resorting to an image resource which matches the BPMN 2.0 xml file resource.
Example: if the deployment contains a BPMN 2.0 xml resource called 'abc.bpmn20.xml' containing only one process with key 'myProcess', then this method will look for an image resources called'abc.myProcess.png' (or .jpg, or .gif, etc.) or 'abc.png' if the previous one wasn't found.
Example 2: if the deployment contains a BPMN 2.0 xml resource called 'abc.bpmn20.xml' containing three processes (with keys a, b and c), then this method will first look for an image resource called 'abc.a.png' before looking for 'abc.png' (likewise for b and c). Note that if abc.a.png, abc.b.png and abc.c.png don't exist, all processes will have the same image: abc.png.
- Returns:
- name of an existing resource, or null if no matching image resource is found in the resources.
-
-