Using Schema Construct xsd choice in a BPM Process
The use of the schema construct xsd:choice in a BPM process can be demonstrated.
The tutorial is an extension of How to Call a TIBCO ActiveMatrix BusinessWorks Service from a BPM Process and demonstrates the mapping of the web service output containing structured data.
The ActiveMatrix BusinessWorks service used in this tutorial provides an address lookup service that takes a postal code as an input, and returns the address (if the postal code specified is valid) or an appropriate message.
You should work through each section in turn to complete the tutorial.
- The business process in this tutorial calls the virtualized ActiveMatrix BusinessWorks service via a web service invocation.
- The input of the business process accepts a postal code as a text string. The ActiveMatrix BusinessWorks process is designed to recognize and return the address for the following postal codes: SN2 8BL, CA 94304, and MA 02144. For all other values, or for an empty postal code, an appropriate error message is returned.
- The address lookup service uses structured data (xsd:choice) to return the address of the postal code.
Prerequisites
- You are familiar with the concepts and working of TIBCO ActiveMatrix BusinessWorks and TIBCO ActiveMatrix BusinessWorks Service Engine.
- You are familiar with WSDLs and schema constructs.
- You have completed the tutorial
How to Call a
TIBCO ActiveMatrix BusinessWorks Service from a BPM Process. If not, you must complete the following tasks described in that tutorial:
- Setting up the Environment required to run the tutorials.
- Importing the Simple Organization Model (Optional).
Before You Begin
Import the TIBCO SOA Project and ActiveMatrix BusinessWorks Project
The projects - TIBCO SOA Project containing the BusinessWorks component, and the associated ActiveMatrix BusinessWorks project - required to test the integration are supplied.
Find the projects ChoiceAddressLookup.zip and ChoiceAddressLookup-BW.zip from the location where you installed TIBCO Business Studio and import them into your Studio for Designers workspace.
- Creating the BPM Developer Project
You must first create a new BPM Developer project. - Importing the ActiveMatrix BusinessWorks Service Engine WSDL
When you import the WSDL file into the BPM Developer’s project, the associated Business Object Model is generated under the Generated Business Objects folder. - Defining the Type Address in the BOM
When implementing a choice, the result of the choice is unknown at design-time. Hence, you need to extract the address from the output type instance before displaying it using the user task. - Defining the Business Process
The output of the web service task implements a choice. Since the outcome of the choice is unknown at design-time, you should not map the individual output fields to the corresponding data fields at design-time. Instead, you must map the response message to the output type instance where both implement the choice. - Deploying the Applications
Before deploying the ActiveMatrix BPM project, ensure that the simple organization model that is referenced by the project is deployed. - Running the Tutorial
You can use TIBCO Workspace to test the integration.