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.

TEST

I am Java Developer. I have 6 year Experiance in this field and like to post in blogging. So keep sharing and like my post

0 comments:

Post a Comment

 

Copyright @ 2017 Liferay Article.