Thursday, 16 November 2017

Pass Values in Workflow

Use WorkflowContext to pass the values from our controller to workflow xml.

In controller:

Map<String, Serializable> workflowContext = new HashMap<String, Serializable>();
workflowContext.put(
"variableName", "variableValue");


And pass workflow context in 

WorkflowHandlerRegistryUtil.startWorkflowInstance 

method.

In xml getting the value:

String customValue = (String)workflowContext.get("variableName");


For long values:

long ownuserId = GetterUtil.getLong((String)workflowContext.get("SomeVariableName"));

So we need to just put in workflow context and we can get it in xml file.

No comments:

Post a Comment