public class TransitionData extends Object
A data wrapper class used to pass information between plan item transitions. See <a href="https://jira.edorasware.com/browse/CLD-7608" >https://jira.edorasware.com/browse/CLD-7608</a>.
<p>Typically, a transition data object is created at the start of a CMMN engine interaction (CMMN rest call or CMMN service bean call). The transition data object is then retained thoughout the call.</p>
Constructor and Description |
---|
TransitionData()
Used for unit testing only.
|
TransitionData(boolean inMigration) |
TransitionData(Map<String,Object> formData,
Map<String,Object> parameters,
Locale locale,
String transitionUserId)
Init transition data with form data and parameters.
|
TransitionData(Map<String,String[]> parameters,
Locale locale,
String transitionUserId)
Init transition data with a parameter map from a servlet request.
|
Modifier and Type | Method and Description |
---|---|
void |
addMigrationResult(String caseClientId,
MigrationResult migrationResult)
Add the result of a migration for a particular case to this transition data.
|
void |
addPrefixedParameter(String prefixedKey,
Object value)
Add a "param" prefixed key (and value) to the parameters map, stripping off the prefix in the target map’s key.
|
void |
addPrefixedParameter(String prefixedKey,
Object value,
boolean overwrite)
Add a "param" prefixed key (and value) to the parameters map, stripping off the prefix in the target map’s key.
|
void |
clear() |
static Map<String,Object> |
convertParameters(Map<String,String[]> parameters)
Convert http servlet request parameters from a Map<String, String[]> to a Map<String, Object>.
|
Map<String,Object> |
getFormData() |
Locale |
getLocale() |
MigrationResult |
getMigrationResult(String caseClientId)
Get the migration result (i.e. re-mapping tables and such) for a particular case by case client Id.
|
Map<String,MigrationResult> |
getMigrationResultByCaseClientId() |
Map<String,Object> |
getParameters() |
String |
getStringParameter(String name) |
String |
getTransitionUserId()
The Id of the user that initiated this transition.
|
int |
getTriggerCounter(Stage stage,
PlannableItem plannableItem) |
Map<String,EventSource> |
getTriggerItems() |
HashMap<String,HashMap<String,Integer>> |
getTriggerTracker() |
boolean |
isForceCaseContext() |
boolean |
isInMigration() |
void |
merge(TransitionData mergeData)
Merge the parameters from
mergData into this object. |
void |
removeParameter(String name) |
void |
restoreTriggerItems(Map<String,PlanItem> planItemInstances,
Map<String,CaseFileItemInstance> caseFileItemInstances) |
void |
setForceCaseContext(boolean forceCaseContext) |
void |
setInMigration(boolean inMigration)
Set this transition data object into migration mode, allowing any CMMN code further down the line to
respond appropriately.
|
void |
setLocale(Locale locale) |
void |
setParameters(Map<String,Object> parameters) |
void |
setStringParameter(String name,
String value) |
void |
setTransitionUserId(String transitionUserId) |
void |
setTriggerItems(Map<String,EventSource> triggerItems) |
void |
trackTrigger(Stage stage,
PlannableItem plannableItem) |
public TransitionData()
Used for unit testing only.
public TransitionData(boolean inMigration)
public TransitionData(Map<String,String[]> parameters, Locale locale, String transitionUserId)
Init transition data with a parameter map from a servlet request.
parameters
- the parameters. For multi-valued parameters, only the first parameter in the string array is taken.public TransitionData(Map<String,Object> formData, Map<String,Object> parameters, Locale locale, String transitionUserId)
Init transition data with form data and parameters. Any form data items having a "param" prefix in their key are considered parameters and are removed from the form data map and put onto the parameters map (without the "param" prefix.
public Map<String,EventSource> getTriggerItems()
null
.public void setTriggerItems(Map<String,EventSource> triggerItems)
public void addPrefixedParameter(String prefixedKey, Object value)
Add a "param" prefixed key (and value) to the parameters map, stripping off the prefix in the target map’s key.
public void addPrefixedParameter(String prefixedKey, Object value, boolean overwrite)
Add a "param" prefixed key (and value) to the parameters map, stripping off the prefix in the target map’s key. The caller may choose not to overwrite an already existing entry for the passed key.
public void clear()
public void trackTrigger(Stage stage, PlannableItem plannableItem)
public int getTriggerCounter(Stage stage, PlannableItem plannableItem)
public void merge(TransitionData mergeData)
Merge the parameters from mergData
into this object. Existing parameter values are left as is. Trigger items are
simply copied by reference, replacing any pre-existing trigger items.
public void restoreTriggerItems(Map<String,PlanItem> planItemInstances, Map<String,CaseFileItemInstance> caseFileItemInstances)
public static Map<String,Object> convertParameters(Map<String,String[]> parameters)
Convert http servlet request parameters from a Map<String, String[]> to a Map<String, Object>. Only the first element in the string array is taken. The method only strips any "param" prefix from keys.
public boolean isForceCaseContext()
public void setForceCaseContext(boolean forceCaseContext)
public String getTransitionUserId()
The Id of the user that initiated this transition.
public void setTransitionUserId(String transitionUserId)
public Locale getLocale()
public void setLocale(Locale locale)
public void removeParameter(String name)
public boolean isInMigration()
true
if the current interaction with the CMMN engine is in migration mode. Return
false
otherwise, which is the normal model of operation.public void setInMigration(boolean inMigration)
Set this transition data object into migration mode, allowing any CMMN code further down the line to respond appropriately. Passing false will restore normal mode and clear any accumulated migration data (like maps of re-mapped model IDs and such).
public void addMigrationResult(String caseClientId, MigrationResult migrationResult)
Add the result of a migration for a particular case to this transition data.
public MigrationResult getMigrationResult(String caseClientId)
Get the migration result (i.e. re-mapping tables and such) for a particular case by case client Id.
public Map<String,MigrationResult> getMigrationResultByCaseClientId()
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.