You normally use a modeling tool, such as IBM® Integration
Designer to
build task templates. You then install the task templates in IBM Business Process Manager and
create instances from these templates, for example, using Business
Process Choreographer Explorer. However, you can also create human
or participating task instances or templates at run time.
About this task
You might want to do this, for example, when the task
definition is not available when the application is deployed, the
tasks that are part of a workflow are not yet known, or you need a
task to cover some ad hoc collaboration between a group of people.
You
can model ad hoc To-do or Collaboration tasks by creating instances
of the com.ibm.task.api.TaskModel class, and using
them to either create a reusable task template, or directly create
a run-once task instance. To create an instance of the TaskModel class,
a set of factory methods is available in the com.ibm.task.api.ClientTaskFactory factory
class. Modeling human tasks at run time is based on the Eclipse Modeling
Framework (EMF).
Procedure
- Create an org.eclipse.emf.ecore.resource.ResourceSet using
the createResourceSet factory method.
- Optional: If you intend to use complex message
types, you can either define them using the org.eclipse.xsd.XSDFactory
that you can get using the factory method getXSDFactory(), or directly
import an existing XML schema using the loadXSDSchema factory
method .
To make the complex types available to the Process Server, deploy
them as part of an enterprise application.
- Create or import a Web Services Definition Language (WSDL)
definition of the type javax.wsdl.Definition.
You can
create a new WSDL definition using the createWSDLDefinition method.
Then you can add it a port type and operation. You can also directly
import an existing WSDL definition using the loadWSDLDefinition factory
method.
- Create the task definition using the createTTask factory
method.
If you want to add or manipulate more complex
task elements, you can use the com.ibm.wbit.tel.TaskFactory class
that you can retrieve using the getTaskFactory factory
method .
- Create the task model using the createTaskModel factory
method, and pass it the resource bundle that you created in the step
1 and which aggregates all other artifacts you created in the meantime.
- Optional: Validate the model using the TaskModel validate method.
Results
Use one of the Human Task Manager EJB API
create methods
that have a
TaskModel parameter to either create
a reusable task template, or a run-once task instance.