You can build a work performer that is based on either a Java™ or Java Message Service (JMS) component queue.
For either of these types of work performers, you need to do some
preparatory work. To develop a Component Integrator-based work performer,
do the following:
Before creating a JMS component queue, set up access to a JMS queue:
- Find the Java Naming and
Directory Interface (JNDI) InitialContextFactory information.
- Before configuring the component queue for JMS, you must know
the name of the JMS queue to which you intend to post messages from
a workflow.
Before creating a Java component
queue, deploy a custom Java class:
- The Java class needs to
conform to the following:
- (Optional)
Create the Java Authentication
and Authorization Service (JAAS) authentication module(s) and login
configuration file for your class, as follows:
- Create a LoginModule class for the systems
your class accesses. Creation and use of LoginModule classes
is described in the JAAS documentation (Security Information).
- Create the JAR file to hold your custom Java class and its corresponding LoginModule
class.
- Use the application server administration tool to configure a
JAAS Login Configuration file containing a LoginContext section (which
specifies your LoginModule class).
Refer to Authentication
and JAAS.
- Create a code module containing the jar files with all of the
items required by custom component.
- Use the Process Configuration Console to create and configure
a component queue for the deployed custom Java class or the JMS queue. Only one class
or JMS queue can be associated with a single workflow system component
queue. However, you can configure multiple component queues for any
given class or JMS queue by assigning different names to the additional
component queues. For instructions, see Manage
component queues.
- When configuring a Java component
queue:
- Associate queue operations with the public methods of the deployed
custom Java component.
- Where applicable, associate each parameter of a Java class method with a corresponding operation
parameter defined for the Component Queue (irrelevant when a method
has no parameters).
- When specifying the polling rate:
The polling rate specifies
the default polling rate when there is work available. The polling
rate setting determines the rate at which the Component Manager polls
component queues for work items requesting services. This rate is
normally set to a few seconds (specified in milliseconds).
- When specifying the batch size:
The batch size specifies the
amount of step elements to query per batch at runtime. The suggested
minimum is 10.
- When specifying operation parameter types:
An attempt to import
an incorrect parameter type for a component method will cause the
import to fail. For specific type mapping information, see Component Operation Parameter
Types.
Important: Ensure that you commit your changes.
- Author a workflow. Use the Process Designer tool to do the
following:
- Add a workflow step that includes at least one
of your Java or JMS components.
This associates the operations for a component queue with a step.
- Defining the parameter values of each operation as an expression
that can include the field values of a work item retrieved from the
component queue.
For an example, see the Content-Extended
Operations example.
- Launch
a workflow that uses your integrated component step and test
the component operations.
How the Component Queues are
Processed
The Component Manager manages the processing between
the workflow system and the Java or
JMS service adapters. Component authentication takes place when the
service adapter initializes.
Java Component
Queues
When a work item is passed to a step that uses a Java component queue, the Java service adapter does the following:
JMS Component Queues
When a work item is
passed to a step that uses a JMS component queue, the JMS service
adapter does the following:
- Sets the values of the operation parameters. These values are
defined by:
- The configuration for the associated component queue.
- The expression specified for the workflow (using Process Designer). The expression
may include field values from the retrieved work item.
- Passes the values of the operation parameters into the stepElement object.
- Marshals the stepElement object for that step
into an XML String that represents the stepElement object.
- Posts the XML String representing the stepElement object
to the external JMS queue configured for the service adapter.
- The work item is not updated. For JMS component queue processing,
the field values of the work item are available for reading only.
- Completes the step by dispatching the work item to a subsequent
step. See Completing the step for
more information.