org.camunda.bpm.cycle.roundtrip
Class BpmnProcessModelUtil

java.lang.Object
  extended by org.camunda.bpm.cycle.roundtrip.BpmnProcessModelUtil

public class BpmnProcessModelUtil
extends Object

Utility Class providing

This class works on the xml representation of a bpmn process model provided as a String.

Author:
Daniel Meyer

Field Summary
static String DEFAULT_ENGINEPOOL_NAME
           
protected  XsltTransformer transformer
           
static String UTF_8
           
 
Constructor Summary
BpmnProcessModelUtil()
           
 
Method Summary
 InputStream extractExecutablePool(InputStream sourceModel)
          Takes a bpmn process model in XML representation as input.
 String extractExecutablePool(String sourceModel)
          Extract executable pool based on string data
protected  byte[] getBytesFromString(String string)
           
protected  String getStringFromBytes(byte[] byteArray)
           
 String importChangesFromExecutableBpmnModel(String sourceModel, String targetModel)
          Import the changes from a source bpmn process model to a target bpmn process model.
 String replaceDeveloperFriendlyIds(String sourceModel)
          Replaces the bpmn element IDs in a process model with developer friendly IDs.
 String replaceDeveloperFriendlyIds(String sourceModel, String processEnginePoolId)
          Replaces the bpmn element IDs in a process model with developer friendly IDs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF_8

public static final String UTF_8
See Also:
Constant Field Values

DEFAULT_ENGINEPOOL_NAME

public static final String DEFAULT_ENGINEPOOL_NAME
See Also:
Constant Field Values

transformer

protected XsltTransformer transformer
Constructor Detail

BpmnProcessModelUtil

public BpmnProcessModelUtil()
Method Detail

replaceDeveloperFriendlyIds

public String replaceDeveloperFriendlyIds(String sourceModel,
                                          String processEnginePoolId)
Replaces the bpmn element IDs in a process model with developer friendly IDs.

Parameters:
sourceModel - a bpmn20 process model in XML representation
processEnginePoolId - allows to provide a custom ID that is used for the first element with 'isExecutable="true"' that is found by the transformer
Returns:
the process model such that the element ids are replaced with developer-friendly IDs

replaceDeveloperFriendlyIds

public String replaceDeveloperFriendlyIds(String sourceModel)
Replaces the bpmn element IDs in a process model with developer friendly IDs.

Parameters:
sourceModel - a bpmn20 process model in XML representation
Returns:
the process model such that the element ids are replaced with developer-friendly IDs

extractExecutablePool

public String extractExecutablePool(String sourceModel)
Extract executable pool based on string data

Parameters:
sourceModel -
Returns:
See Also:
extractExecutablePool(java.io.InputStream)

extractExecutablePool

public InputStream extractExecutablePool(InputStream sourceModel)
Takes a bpmn process model in XML representation as input. Removes all pools except for a single executable pool (property 'isExecutable="true"). NOTE: assumes that the process model contains a single executable pool.

Parameters:
sourceModel - a bpmn20 process model in XML representation
Returns:
the process model containing the extracted pool

importChangesFromExecutableBpmnModel

public String importChangesFromExecutableBpmnModel(String sourceModel,
                                                   String targetModel)
Import the changes from a source bpmn process model to a target bpmn process model.


getBytesFromString

protected byte[] getBytesFromString(String string)

getStringFromBytes

protected String getStringFromBytes(byte[] byteArray)


Copyright © 2014 camunda services GmbH. All rights reserved.