01: /*
02: * JBoss, Home of Professional Open Source
03: * Copyright 2005, JBoss Inc., and individual contributors as indicated
04: * by the @authors tag. See the copyright.txt in the distribution for a
05: * full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jbpm.taskmgmt.def;
23:
24: import java.io.Serializable;
25:
26: import org.jbpm.context.exe.ContextInstance;
27: import org.jbpm.graph.exe.Token;
28: import org.jbpm.taskmgmt.exe.TaskInstance;
29:
30: public interface TaskControllerHandler extends Serializable {
31:
32: /**
33: * extracts all information from the process context (optionally indirect) and
34: * initializes the task instance variables.
35: * <p>Use {@link TaskInstance#setVariable(String, Object)} to set variables
36: * in the task instance and use {@link ContextInstance#getVariable(String, Token)}
37: * to get access to the process variables.</p>
38: * <p>The task instance variable can be
39: * <ul>
40: * <li>A copy of process variable value</li>
41: * <li>A reference to a process variable</li>
42: * <li>Any object that can be persisted as a variable. This is usefull in case
43: * a {@link TaskInstance} variable is a function of other process instance
44: * variables.
45: * </li>
46: * </ul>
47: * </p>
48: * <p>In order to create a reference to an existing process variable, insert
49: * a {@link org.jbpm.context.exe.VariableInstance} as a value in the returned map.
50: * If the TaskInstance is to have copies of the process instance variables, just
51: * insert POJO's (non-VariableInstance classes) as values for the TaskInstance variables.
52: * </p>
53: */
54: void initializeTaskVariables(TaskInstance taskInstance,
55: ContextInstance contextInstance, Token token);
56:
57: /**
58: * is called when a task completes. The task controller is given the opportunity to
59: * update the process context variables with the data that is submitted entered in the
60: * task instance.
61: * <p>Use {@link TaskInstance#getVariable(String)} to get variables from the task
62: * instance context and use {@link ContextInstance#setVariable(String, Object, Token)}
63: * to update the process variables.
64: * </p>
65: */
66: void submitTaskVariables(TaskInstance taskInstance,
67: ContextInstance contextInstance, Token token);
68:
69: }
|