[jboss-user] [JBoss jBPM] - Re: java.lang.ClassNotFoundException

zhouliuqq do-not-reply at jboss.com
Mon Jul 30 03:28:37 EDT 2007


   public BpmTask startWorkFlowByDefinitionName(final String definitionName,final String usercode,final boolean flag){
    	
		return (BpmTask)jbpmTemplate.execute(new JbpmCallback(){
			public BpmTask doInJbpm(JbpmContext context) {
				try{
    	    		ProcessDefinition definition=getDefinitionByName(definitionName);
    	    		ProcessInstance processInstance=new ProcessInstance(definition);
                    // create the start task if one exists
                    Token token = processInstance.getRootToken();
                    //???CONTEXT?????
                    token.signal();
                    // Save the process instance along with the task instance
                //???????????????????????????????????
                processInstance.getContextInstance().setVariable("startUserCode", usercode);
                processInstance.getContextInstance().setVariable("parentId", processInstance.getId());
                TaskInstance nexttaskInstance=getTaskInstanceByToken(processInstance.getTaskMgmtInstance(),token);
                if (flag){
                	nexttaskInstance.start();
                }
                context.save(processInstance);
                Session session=context.getSession();
                Processmain processmain=new Processmain();
                processmain.setProcessid(processInstance.getId());
                processmain.setProcessname(processInstance.getProcessDefinition().getName());
                processmain.setStartdate(processInstance.getStart());
                processmain.setUsercode(usercode);
                session.save(processmain);
                return createWorkflowTask(null, nexttaskInstance);
		    	}catch(Exception e){
		    		e.printStackTrace();
		    		throw new JbpmException("processInstance init fail"+e.getMessage());
		    	}
			}
		});



process-definition
  xmlns=""  name="Undwrtdefinition">
   <start-state name="start">
      
      
         <action name="action1" class="cn.com.picc.claim.bpm.handler.ToStartHandler" config-type="bean">
      
      
   </start-state>


 

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

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



More information about the jboss-user mailing list