Hi,
I had now twice the need for a new feature, thus I would like to utter a feature request. I am not sure if this is the right place, but it is worth a try.
From looking at the examples, the Seam-way to work with processes is to
1. Create a process (@CreateProcess)
2. Show a list with the tasks
3. Start working with a task by selecting one in the list (@StartTask)
This is really convenient.
But what I need is one step to
- create a process and
- start working an the first task in a long running conversation with associated business process context.
In short, something such as @CreateProcessAndStartTask.
What I did in the current project to achieve the same effect, is this:
@Begin public String initialize() { businessProcess.createProcess(PROCESS_NAME); final Long processId = businessProcess.getProcessId(); final ProcessInstance processInstance = jbpmContext.getProcessInstance(processId); final Collection taskInstances = processInstance.getTaskMgmtInstance().getTaskInstances(); final TaskInstance task = (TaskInstance) taskInstances.iterator().next(); businessProcess.setTaskId(task.getId()); businessProcess.startTask(); return "createNewOffer"; }