Hi all Seam users !
I'm developing a trouble ticket system and I started from the example found in the Seam distribution named TodoList
.
That's a good starting point: the problem is that I need to retreive the processId once I have called @CreateProcess method, because I need to insert the processId in a EJB which hosts Ticket information.
I have tried Injecting the processInstance in the class, yet still I get a null
when I reference the processInstance.
What can I do ? should I turn it in a Stateful Bean ?
Thanks for your help
Mark
@Name("todoList") public class TodoList { @In private Actor actor; @In(value="processInstance", required=false, scope=ScopeType.BUSINESS_PROCESS) @Out(value="processInstance", required=false) ProcessInstance processInstance; private String description; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @CreateProcess(definition="todo") public void createTodo() {} @StartTask @EndTask public void done() {} public void showProcessId() { try { System.out.println("Actual ProcessID: " + processInstance); } catch (Exception e) { e.printStackTrace(); } } }
Try injecting from the correct scope:
@In(create=true) ProcessInstance processInstance;