-
1. Re: Unique and dynamic Process instance id
kukeltje May 4, 2006 10:33 AM (in response to mraja775)Adding attributes or custom xml is not realy possible yet. You can achieve some things, but they might change, therefor I do not recommend these.
What I do myself is when I start a process from a bean (customized version of the jbpm 3.1 webapp (I modified the HomeBean)), I immediately set a process variable with a guid. This works great.
hth. -
2. Re: Unique and dynamic Process instance id
icyjamie May 5, 2006 2:20 AM (in response to mraja775)Relatively simple by having handlers creating/adding all sorts of vars like this (package and imports not shown):
public class VariableActionHandler implements ActionHandler { private String name; private String method; private String value; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public void execute(ExecutionContext executionContext) throws Exception { if ("NAMEVALUE".equals(method)) { executionContext.getContextInstance().setVariable(name, value); } else { // perform other methods like injecting GUIDS, Unique IDS, forward to business logic, etch... } } }
Then, in your definition, use an action e.g.<node> <action class="VariableActionHandler" config-type="bean"> <name>processId</name> <value>123</value> <method>NAMEVALUE</method> </action> </node> <node> <action class="VariableActionHandler" config-type="bean"> <name>processId</name> <method>GENERATEGUID</method> </action> </node>
-
3. Re: Unique and dynamic Process instance id
kukeltje May 5, 2006 2:54 AM (in response to mraja775)Yes, but *not* at the start of a process right? If I have a start task I cannot use this. I even tried task-assign events on the start task, but was not able to set variables that could be used this way at start time.
For this reason I created a Jira issue to be able to pass variables when creating a process.