01: package org.emforge.jbpm.event;
02:
03: import org.emforge.jbpm.ProcessTransformer;
04: import org.jbpm.graph.def.ActionHandler;
05: import org.jbpm.graph.exe.ExecutionContext;
06:
07: /** Event for handling task creation
08: *
09: * This event is responsible for Process Priority propagation
10: * Currently jBPM core doesn't have priority propagation
11: * (see: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=79222 for details)
12: * So, we wrote method to make it by ourself
13: */
14: public class TaskCreatedEvent implements ActionHandler {
15: private static final long serialVersionUID = 354326189710842979L;
16:
17: public void execute(ExecutionContext i_context) throws Exception {
18: // get priority from process variable
19: i_context.getTaskInstance().setPriority(
20: ProcessTransformer.getPriority(i_context
21: .getProcessInstance()));
22:
23: // and process due date as task due date
24: i_context.getTaskInstance().setDueDate(
25: ProcessTransformer.getDueDate(i_context
26: .getProcessInstance()));
27: }
28: }
|