1 5 package com.opensymphony.workflow.timer; 6 7 import com.opensymphony.workflow.Workflow; 8 import com.opensymphony.workflow.WorkflowException; 9 import com.opensymphony.workflow.basic.BasicWorkflow; 10 11 import org.quartz.Job; 12 import org.quartz.JobDataMap; 13 import org.quartz.JobExecutionContext; 14 import org.quartz.JobExecutionException; 15 16 17 23 public class LocalWorkflowJob implements Job { 24 26 public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { 27 JobDataMap data = jobExecutionContext.getJobDetail().getJobDataMap(); 28 long id = data.getLong("entryId"); 29 int triggerId = data.getInt("triggerId"); 30 String username = data.getString("username"); 31 Workflow wf = new BasicWorkflow(username); 32 33 try { 34 wf.executeTriggerFunction(id, triggerId); 35 } catch (WorkflowException e) { 36 throw new JobExecutionException("Error Executing local job", (e.getRootCause() != null) ? (Exception ) e.getRootCause() : e, true); 39 } 40 } 41 } 42 | Popular Tags |