Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

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

scott.stark@jboss.org

2007-07-11


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.