01: package org.jbpm.command;
02:
03: import org.jbpm.JbpmContext;
04:
05: /**
06: * The current authorizes actor starts to work on the TaskInstance
07: * so the actor is set to the given actor
08: *
09: * @author Bernd Ruecker
10: */
11: public class StartWorkOnTaskCommand implements Command {
12:
13: private static final long serialVersionUID = 53004484398726736L;
14:
15: private long taskInstanceId;
16:
17: private boolean overwriteSwimlane = false;
18:
19: public StartWorkOnTaskCommand(long taskInstanceId,
20: boolean overwriteSwimlane) {
21: this .taskInstanceId = taskInstanceId;
22: this .overwriteSwimlane = overwriteSwimlane;
23: }
24:
25: public StartWorkOnTaskCommand() {
26: }
27:
28: public Object execute(JbpmContext jbpmContext) throws Exception {
29: jbpmContext.getTaskInstance(taskInstanceId).start(
30: jbpmContext.getActorId(), overwriteSwimlane);
31: return null;
32: }
33:
34: public boolean isOverwriteSwimlane() {
35: return overwriteSwimlane;
36: }
37:
38: public void setOverwriteSwimlane(boolean overwriteSwimlane) {
39: this .overwriteSwimlane = overwriteSwimlane;
40: }
41:
42: public long getTaskInstanceId() {
43: return taskInstanceId;
44: }
45:
46: public void setTaskInstanceId(long taskInstanceId) {
47: this.taskInstanceId = taskInstanceId;
48: }
49:
50: }
|