We can pass single/multiple context variable from Parent process flow to Child Flow by using attached Custom Plugin.
Use this Plugin in the Child Flow and set the variables in both the Process Flow's as defined in Plugin.
import java.util.*;
// edit it to specify the name of Call or Spawn action used in process flow
String childName = "Call1";
Map map = (Map) context.get(childName + ".childContext");
if (map == null) {
map = new HashMap();
}
// use this statement multiple times depending upon the number of variables to be set in child (sub-process) flow
// if you need to set 4 parameters in child flow, use this statement 4 times (with different values of childVarName and parentVarName)
// "childVarName" represent variable name in child flow, "parentVarName" represents variable name in parent flow whose value needs to be set in child flow
// for example : map.put("PolicyNumber", context.get("PolicyNumber"));
map.put("childVarName", context.get("parentVarName"));
// setting context variables for child (sub-process) flow
context.put(childName + ".childContext", map);
Comments
0 comments
Article is closed for comments.