JBoss Community

JBPM mail using JSF expressions, how?

reply from jDev Dev in jBPM - View the full discussion

... And  this is my class that deploys the process and starts job executions

public void execute() throws Exception 
    {
        ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("TimerProcess/Tprocessdefinition.xml");
        JbpmContext jbpmContext= JbpmConfiguration.getInstance().createJbpmContext();
     
        System.out.println("------ parsing");
       
        try{
            // Create an instance of the process definition.
            ProcessInstance instance = processDefinition.createProcessInstance();
            System.out.println("------------ deploying process");
            jbpmContext.deployProcessDefinition(processDefinition);
            instance.signal("trSetTimer");
            JobExecutor jobExecutor =  jbpmContext.getJbpmConfiguration().getJobExecutor();

 


            if  (jobExecutor==null) {
                throw new JbpmException("no job executor configured in resource  ");
                }  
            jobExecutor.start();

            jbpmContext.save(instance);
        }finally{
            jbpmContext.close();
             }        
        }
}

Reply to this message by going to Community

Start a new discussion in jBPM at Community