[jboss-user] [JBoss jBPM] - Re: How to reassign from group to actor using CommandService

gfargone do-not-reply at jboss.com
Tue Mar 31 14:50:06 EDT 2009


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);

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4222433#4222433

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4222433



More information about the jboss-user mailing list