Overview for creating actions in variable workflow

When the inbound workflow is completed, the appropriate variable workflow path is determined by the participant connection. This variable workflow, or action, is specified in the Community Console by the hub administrator while creating the interactions. For more information on using the Community Console to configure participant connections and variable workflows, see the Hub Configuration Guide.

An action is a number of steps, arranged in a sequence. WebSphere Partner Gateway ships with eleven predefined actions. If other options are required, you can customize a variable workflow by defining new actions. You can do this in either of two ways:

Note: Not all steps delivered by WebSphere Partner Gateway can be used in new, user-defined actions. Some are used by WebSphere Partner Gateway for internal purposes. For more detailed information, see Actions supplied by WebSphere Partner Gateway

Actions consist of a series of steps, the sequence of which is configured in the Community Console, as shown in Figure 8 and Figure 9. The steps can be reused across the actions.

Figure 8. Creating an action by configuring a sequence of steps
Creating an action by configuring a sequence of steps
Figure 9. Creating an action by configuring a sequence of steps
Creating an action by configuring a sequence of steps

You can also create multiple actions by using the same set of steps but by specifying a different sequence. Note that reusability of steps depends on their intended use and their dependency on other steps.

While running the action (the variable workflow), the BPE runs these steps one after the other in the sequence these steps are specified for this action. Steps of an action implement the BusinessProcessInterface class. The BPE runs the process method of the steps. After running each step, the BPE logs the events generated by this process method. The BPE checks the status of the business document. If its status is marked as failed, the BPE fails the flow of business document. The next step is run only if the business document status is not marked as failed.

Typically steps include the following types:

Validation
Checking the form of the business document. For example, an XML document can be validated against an XML schema.
Transformation
Changing the form of the business document. For example, an XML document can be transformed into a different XML document using XSLT.
Translation
Changing the entire format of a business document from one type to another. For example, an XML document can be transformed into CSV (comma separated value) format.

Note: These steps are typical examples only. The actual steps depend on your business protocol requirements.

Creating steps

To create a step:

  1. Create a class that implements BusinessProcessFactoryInterface. This class is factory class for constructing objects of type BusinessProcessInterface, which represents the steps of variable workflow.
  2. Implement the BusinessProcessFactoryInterface.getBusinessProcess method. This method constructs an object of type BusinessProcessInterface, which can process the business document.
  3. Implement the BusinessProcessFactoryInterface.returnBusinessProcess method. This factory can reuse or discard the BusinessProcessInterface object that is being returned.
  4. Create a class that implements BusinessProcessInterface. This class is the actual step.
  5. Implement the BusinessProcessInterface.process method. Implement the processing logic of the step here. This method also performs the following actions:
    1. Add events to the BusinessDocumentInterface object. You can do this by calling the addEvent method. These events will be visible in the Community Console with this business document. For a list of events that you can add in this step, see Events.
    2. Update the status of the BusinessDocumentInterface object. If there were any errors, mark BusinessDocumentInterface as failed by calling the setDocumentState method with the BCGDocumentConstants.BCG_DOCSTATE_FAILED argument.
  6. Implement the BusinessProcessInterface.reset method. If this factory is caching BusinessProcessInterface objects, it can call this method to reset the state of a BusinessProcessInterface object. You can then reuse the BusinessProcessInterface object.
  7. Create a deployment descriptor for this step. For information on how to deploy your step, see Development and deployment.
  8. Use the Community Console to upload your step. Click Import on the Handler List page as shown in Figure 10, and then upload the step on the Import Handler page as shown in Figure 11.
    Figure 10. Opening the Import Handler page
    Opening the Import Handler page
    Figure 11. Uploading a step
    Uploading a step

Now you can use this step for creating your actions.

Actions supplied by WebSphere Partner Gateway

WebSphere Partner Gateway ships with seventeen predefined actions. Some, but not all, of these actions and the steps that make them up are available for you to customize. A list of the supplied actions and the degree they can be utilized for user-customized actions follows.

Pass through

This action can be copied and modified. Steps can be pre-pended or appended to the action sequence.

HubOwner cancellation of RN process

This action cannot be copied and modified. It is specific to the RosettaNet protocol.

RN pass through with process logging

This action can be copied and modified. You can append steps to the action sequence.

Bidirectional translation of RN and RNSC

This action cannot be copied and modified. It is used for RNIF messages.

Bidirectional translation of RN and XML

This action cannot be copied and modified. It is used for RNIF messages.

Bidirectional translation of custom XML with validation

This action can be copied and modified. User-defined steps can be substituted for the following three supplied steps: ValidationFactory, XSLTTranslationFactory, and OutboundValidationFactory. Additional steps can be pre-pended or appended. The supplied steps perform the following actions:

ValidationFactory
Validates the received custom XML document
XSLTTranslationFactory
Transforms the received XML document into its outbound XML format
OutboundValidationFactory
Validates the transformed document

The steps cannot be used in other user actions outside the context of a copied action.

Bidirectional translation of custom XML with duplicate check and validation

This action can be copied and modified. User-defined steps can be substituted for the following three supplied steps: ValidationFactory, XSLTTranslationFactory, and OutboundValidationFactory. Additional steps can be pre-pended or appended. The supplied steps perform the following actions:

ValidationFactory
Validates the received custom XML document.
XSLTTranslationFactory
Transforms the received XML document into its outbound XML format.
OutboundValidationFactory
Validates the transformed document.

The steps cannot be used in other user actions outside of the context of a copied action.

Bidirectional translation of owner custom XML to RN with duplicate check and validation

This action cannot be copied or modified. It is specific to RNIF messages.

Custom XML pass through with duplicate check and validation

This action can be copied and modified. Additional steps can be pre-pended or appended.

Custom XML pass through with duplicate check

This action cannot be copied and modified. Additional steps can be pre-pended or appended.

Custom XML pass through with validation

This action can be copied and modified. A user-defined step can be substituted for the ValidationFactory step.

The ValidationFactory step validates the received custom XML document.

EDI Interchange De-envelope

This action cannot be copied and modified. The supplied steps perform the following actions:

de-enveloper
De-envelopes an EDI Interchange.

EDI Validate and Transform

These actions can be copied and modified. The supplied steps perform the following actions:

SourceEDIValidation
Validates an EDI transaction.
EDITransformation
Transforms an EDI transaction.

XML Transform and EDI Validate

These actions can be copied and modified. The supplied steps perform the following actions:

XMLTransformation
Transforms an XML document into an EDI document.
TargetEDIValidation
Validates the EDI document.

ROD Transform and EDI Validate

These actions can be copied and modified. The supplied steps perform the following actions:

RODTransformation

Transforms an ROD document into an EDI document.
TargetEDIValidation
Validates the EDI document.

Copyright IBM Corp. 2003, 2005