-
1. Re: How to reassign from group to actor using CommandService
gfargone Mar 31, 2009 2:48 PM (in response to gfargone)I forgot to mention that trying to set the actor Id on a TaskInstance fails with the LazyInitializationException. Is the session closing immediately after the GetTaskListCommand normal?
11:10:25,977 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: org.jbpm.taskmgmt.def.Task.events, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.taskmgmt.def.Task.events, no session or session was closed -
2. Re: How to reassign from group to actor using CommandService
gfargone Mar 31, 2009 2:50 PM (in response to gfargone)Here is some code I was trying:
// Get context.
InitialContext ic = new InitialContext();
// Find the command service bean.
rcs = (RemoteCommandServiceHome) ic.lookup("ejb/CommandServiceBean");
// Create a new process instance.
StartProcessInstanceCommand newProcessInstance = new StartProcessInstanceCommand();
newProcessInstance.setProcessName("CreateDevice");
newProcessInstance.setStartTransitionName("start");
newProcessInstance.setActorId("ffvnqb");
// Set process variables.
newProcessInstance.setVariables(varMap);
ProcessInstance procInst = (ProcessInstance) rcs.create().execute(newProcessInstance);
Long processId = procInst.getId();
System.out.println("Process Id: " + processId);
long taskInstanceId = 0;
// Get task list. Include task variables.
GetTaskListCommand taskListCommand = new GetTaskListCommand("admin",true);
List taskInstanceList = (List) rcs.create().execute(taskListCommand);
for (TaskInstance task : taskInstanceList) {
System.out.println("Task Name: " + task.getName());
System.out.println("Task Instance Id: " + task.getId());
System.out.println("Original Task Assignment: " + task.getActorId());
taskInstanceId = task.getId();
}
//
StartWorkOnTaskCommand startTaskCommand = new StartWorkOnTaskCommand(taskInstanceId, true);
rcs.create().execute(startTaskCommand); -
3. Re: How to reassign from group to actor using CommandService
gfargone Mar 31, 2009 4:07 PM (in response to gfargone)Oh, I am using jBPM 3.2.4.GA
-
4. Re: How to reassign from group to actor using CommandService
kukeltje Apr 1, 2009 9:24 AM (in response to gfargone)Is the session closing immediately after the GetTaskListCommand normal?
Yes -
5. Re: How to reassign from group to actor using CommandService
gfargone Apr 1, 2009 3:39 PM (in response to gfargone)"kukeltje" wrote:
Is the session closing immediately after the GetTaskListCommand normal?
Yes
That makes sense. Through RMI/IIOP cannot have a session open.
GOOD NEWS!!!
So I just compared the source code of the org.jbpm.command packages, and found that the actorId cannot be set on the StartWorkOnTaskCommand in version 3.2.4.GA.
Fortunately, in version 3.2.6.SP1 the method to set the actorId IS present.
Hopefully it is a smooth upgrade.
Thanks,
Tamas