-
1. Re: Dynamic Process Instances
estaub Apr 2, 2008 3:03 PM (in response to jimtbds)In the specific case you talk about, a loop is probably a good design fit - all chapters are similar, presumably.
In the similar case of a dynamic number of similar parallel activities, a fork can be told to generate as many similar child tokens (like threads) as necessary. -
2. Re: Dynamic Process Instances
jimtbds Apr 2, 2008 4:08 PM (in response to jimtbds)I don't think a loop does the job. I have multiple n authors that can concurrently document m chapters. I would imagine a "create draft" for each chapter. However the number of chapters can change dynamically - eg: we can decide we need more chapters.
I was looking at the task management chapter in the user doc
11.2.2. Task instances and graph execution
And it seemed to suggest multiple taskInstances for a task node:
public class CreateTasks implements ActionHandler {
public void execute(ExecutionContext executionContext) throws Exception {
Token token = executionContext.getToken();
TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();
TaskNode taskNode = (TaskNode) executionContext.getNode();
Task changeNappy = taskNode.getTask("change nappy");
// now, 2 task instances are created for the same task.
tmi.createTaskInstance(changeNappy, token);
tmi.createTaskInstance(changeNappy, token);
}
} -
3. Re: Dynamic Process Instances
estaub Apr 2, 2008 5:04 PM (in response to jimtbds)Ah, ok, so it's parallel, not sequential. Then use the dynamic fork. See http://wiki.jboss.org/wiki/Wiki.jsp?page=ForEachForkActionHandler.
-
4. Re: Dynamic Process Instances
jimtbds Apr 2, 2008 5:49 PM (in response to jimtbds)Dynamic Fork looks good, however, new chapters may be needed after the dynamic fork has fired. For example, the dynamic fork fires and there are 10 chapters needed and 10 tasks get created for those tasks. During the authoring of oneof those chapters it is determined that another chapter is needed - how is that introduced?
As well, you did not comment on the task instance example of the previous post - how do you interpret that code? -
5. Re: Dynamic Process Instances
kukeltje Apr 3, 2008 9:53 AM (in response to jimtbds)how is that introduced?
Almost identical I would hope, just look up the token that is in the parent node (the fork) and add an additional task
-
6. Re: Dynamic Process Instances
estaub Apr 3, 2008 10:53 AM (in response to jimtbds)>> As well, you did not comment on the task instance example of the previous post - how do you interpret that code?
Sorry, I don't remember much about the task support - I don't have the time to research it.