[jboss-user] [JBoss jBPM] - Re: problem to start a taskinstance

galvino do-not-reply at jboss.com
Wed Jul 11 09:56:13 EDT 2007


hi, thanks to response to my first post.

iam using  

  | jbpm-3.1.4 
  | jboss-4.0.4.GA (download with jems-installer-1.2.0.GA.jar)
  | mysql server 5.0
  | 
  |      
  | i want to do an struts application by using jbpm API.
  | so i set some configurations and i want to get a task list for one user i have this error.
  | 
  | this my workflow :
  | 
  | anonymous wrote : 
  |   | <process-definition
  |   |   xmlns=""  name="holiday-request">
  |   |    
  |   |    
  |   |    <start-state name="enter request">
  |   |       
  |   |          
  |   |             
  |   |             
  |   |          
  |   |       
  |   |       
  |   |    </start-state>
  |   |    <task-node name="evaluate request">
  |   |       
  |   |          
  |   |             
  |   |             
  |   |             
  |   |             
  |   |          
  |   |       
  |   |       
  |   |       
  |   |    </task-node>
  |   |    <task-node name="give additional info">
  |   |       
  |   |          
  |   |             
  |   |             
  |   |             
  |   |          
  |   |       
  |   |       
  |   |    </task-node>
  |   |    <end-state name="end"></end-state>
  |   | </process-definition>
  |   | 
  | 
  | this is that i do:
  | 
  | anonymous wrote : 
  |   | protected ActionForward performAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  |   | 								
  |   | 		System.out.println("\n................StartProcessInstance.............................\n");
  |   | 		JbpmContext jbpmContext=null;
  |   | 		GraphSession graphSession=null;
  |   | 		TaskMgmtSession taskMgmtSession=null;
  |   | 		ArrayList tasks;
  |   | 		
  |   | 		jbpmContext=this.getJbpmContext(request).getJbpmConfiguration().getCurrentJbpmContext();
  |   | 		graphSession=jbpmContext.getGraphSession();
  |   | 		taskMgmtSession=jbpmContext.getTaskMgmtSession();
  |   | 		
  |   | 			try{
  |   | 				
  |   | 				ProcessDefinition processDefinition = graphSession.loadProcessDefinition(2);
  |   | 
  |   | 			    // create a new process instance to run
  |   | 			    ProcessInstance processInstance = new ProcessInstance(processDefinition);
  |   | 
  |   | 			    // create a new taskinstance for the start task
  |   | 			    TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
  |   | 			    taskInstance.setActorId(jbpmContext.getActorId());
  |   | 			    
  |   | 			    // Save the process instance along with the task instance
  |   | 			    jbpmContext.save(processInstance);
  |   | 				
  |   | 				
  |   | 				this.setJbpmContext(request, jbpmContext);
  |   | 				
  |   | 			}catch(JbpmException e){
  |   | 				e.printStackTrace();
  |   | 			}finally{
  |   | 				if(this.getJbpmContext(request) != null) {
  |   | 					try {
  |   | 						this.getJbpmContext(request).close();
  |   | 					} catch (JbpmException e) {
  |   | 						e.printStackTrace();
  |   | 					}
  |   | 				}
  |   | 			}
  |   | 			return 	mapping.findForward("success");
  |   | 		}
  |   | 	
  |   | 

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

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



More information about the jboss-user mailing list