There appears to be a problem with CommandFactory.newStartProcess in Drools 5.2 M1. If I do this:
String someString = "Some String";
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("someString", someString);
List<Command<?>> cmds = new ArrayList<Command<?>>();
cmds.add(CommandFactory.newStartProcess("SampleFlow", variables));
cmds.add(CommandFactory.newFireAllRules());
The default value for the someString variable in SampleFlow does NOT get updated. However, if I do this:
String someString = "Some String";
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("someString", someString);
List<Command<?>> cmds = new ArrayList<Command<?>>();
StartProcessCommand cmd = new StartProcessCommand();
cmd.setProcessId("SampleFlow");
cmd.setParameters(variables);
cmds.add(cmd);
cmds.add(CommandFactory.newFireAllRules());
the someString variable does get updated. However, StartProcessCommand is not intended to be used (Discouraged Access), so I don’t want to use this solution.
Dan