Lab #8 Page 1 of 9 - ActiveVOS Fundamentals ActiveVOS Fundamentals Lab #8 Process Orchestration
Lab #8 Page 2 of 9 - ActiveVOS Fundamentals Lab Plan In this lab we will build a basic sales order type of process with a consumer and multiple providers. When the process is completed we will simulate, deploy and run it. Lab Prep Before starting make sure that you: - There are no pre-requisites or dependencies for this lab - Close all existing projects in the workspace Lab Steps A. Create a new Orchestration Project 1. While in the same workspace, we will close all other projects to unclutter the current workspace. Once all other projects are closed, we will create a new project for our next process. a.use File / New / Orchestration project to create a new project and name it ActiveVOS_8_Retailer. b. Click Next and select Java Enabled Orchestration. c. Click Finish. d. Import the following schema, wsdl and sample-data files: 1. Schema: Import all schema in the Resources / Schema folder. 2. WSDL: Import all WSDL in the Resources / WSDL folder. 3. Sample-Data: Import all sample files in the Resources / sample-data folder. e. Right click on the BPEL folder and use New / BPEL Process to create a new process file named Retailer.bpel in the BPEL folder. f. Click Finish. Now that we have a process file all the other view and windows in the GUI are enabled. The two errors on the Problems view are expected. B. Define a New Process Service Consumer 1. In this section we will define a new Process Service Consumer, which in this case is the Customer who will be using the process. a. Go to Participant s view, right-click on Process Service Consumers and select New Process Service Consumer b. Name the new participant Customer. c. Drill into the Project and Project Reference Services and select the RetailerPortType. This is the porttype that we will expose to the customer. d. Click OK.
Lab #8 Page 3 of 9 - ActiveVOS Fundamentals C. Define New Partner Service Providers 1. Recall that our partner service providers are those who offer functionality to the executing process. We will now define two partners one to log the customer s order into an auditing system and one that will run a credit check on the customer. a. In Participant s view, select Partner Service Providers. b. Right-click and select New Partner Service Provider c. Name the new provider Auditor and select the AuditPortType. d. Click OK.
Lab #8 Page 4 of 9 - ActiveVOS Fundamentals e. In Participant s view, select Partner Service Providers. f. Right-click and select New Partner Service Provider g. Name it CreditManager and select the CreditManagerPortType. h. Click OK. D. Orchestrate the process 1. We have defined a Customer, who consumes the functionality from the process, and we have defined two Partners who will provide functionality to the process. Now that we have the players and their operations defined, we can orchestrate the actual events and activities that define the process. First, we will add the actions of the Customer, who will create the process instance by sending us an order request. a. Drag the SubmitOrder operation to the canvas and drop it. b. Name the new Message receive activity Receive Customer s Order. c. Enable the Create Instance checkbox. d. On its Data tab, create a new variable called SubmitOrderRequest. e. Rename the Message reply activity as Acknowledge Customer s Order.
Lab #8 Page 5 of 9 - ActiveVOS Fundamentals f. Now we have to decide how to populate the response message of the reply. On the reply s Data tab, select XPaths as the Assignment Type. For this copy operation we will use the XPaths technique, which treats the copy operation as part of the activity itself, instead of creating it using a separate Assign activity on the canvas. The source code for the resulting process is identical and, in fact, XPaths actually creates an implicit Assign activity in the underlying source code. Using this XPath technique can keep your canvas from being cluttered with Assigns as you move and copy your process data. g. Click the Add button to add a new row for XPath assignments. h. Once the row has been added, you can type simple expressions and values into the fields directly or click on the ellipsis button to use the Expression Builder. The From and To columns you see here are exactly the same as the From and To fields we saw when using the Assign activity and its Copy Operations dialog. Build the XPath assignment shown here: This XPath shown is a simple assignment of the expression true() to the variable customerorderack, which is the reply message we send back to the Customer. The From value is the expression true() and the To Path is a single dot. The XML syntax for the. operator means a single element at this node or this context. 2. Now we re going to introduce our first Partner Service Provider to the process. This process will continue by executing a one-way invoke request that sends the Customer s order information to an off-site Auditing system, using the AuditorPortType and its LogPurchaseOrder operation.
Lab #8 Page 6 of 9 - ActiveVOS Fundamentals a. From Participant s view, drag and drop the LogPurchaseOrder operation onto the canvas after the Reply, but still inside the blue bounding box. b. Rename this invoke activity Log the Customer s Order. Notice that when we added the new Invoke activity after the Reply, it changed the Reply s rendering style from an End Event to an Intermediate Event automatically. It is now shown with a double line, instead of the single, Bold line of an End Event, because now it is in the middle of the process, not at the end. c. For the Input to this invoke activity, we will continue to use XPaths. (Note that, because Invokes can have both Input and Output, it has a separate tab to define each.) Select the Input tab of your new Invoke activity. d. For Assignment Type: select XPaths from the droplist. e. Click the Add button to add a new Row for the assignment. f. Find the From column, then click in the field under it and click on the ellipsis ( ) button that appears. g. When the Expression Builder opens, go to the Variables pane and open the SubmitOrderRequest variable. Find the customernumber element and doubleclick (or select it and click Insert) to add it to the Expression: field. This sets it as the Source (i.e., the From) for the copy operation.
Lab #8 Page 7 of 9 - ActiveVOS Fundamentals h. Click OK. i. Open the Query Builder by clicking in the To Path field, then on the ellipsis button. j. The Query Builder shows the Invoke s Input message (which is defined in Audit.xsd, and used by Audit.wsdl.) We need to set the To Path, which is where in that input message we are going to copy the customernumber data. Select customernumber in the dialog. As you may have noticed, opening the To Path query builder is also a good way to see the definition of the variable you are populating with these copy operations.
Lab #8 Page 8 of 9 - ActiveVOS Fundamentals k. Click OK. Your assignment should look like the screenshot below. (Note that your namespace prefixes [e.g., ns3:, ns4:] may be different than what is shown. Consult the ActiveVOS Help system for more information.) Copy this data to this location. l. Create three more XPath assignments, one for each of the remaining elements, so that the Input tab looks like this: 3. Now we re going to add a second Partner Service Provider to the process. This time we ll run a Credit Check on our customer using the CreditManagerPortType s CheckCredit operation. a. From Participant s view, drag and drop the CheckCredit operation onto the canvas after the Audit invoke, but stay inside the blue bounding box. b. Rename this new service activity Run Credit Check. c. On the Input tab, create two XPath assignments that look like this: d. On the Output tab, create a single variable called CheckCreditResponse.
Lab #8 Page 9 of 9 - ActiveVOS Fundamentals e. Go to the Palette and drag a None event from the Throw tray and drop it at the end of the process. NOTE: The End event in this case functions much like the period at the end of a sentence. It does not execute anything and does not change the logic of the process, but it does make the process more complete and easier to read. It is part of the BPMN process design specification and Business Analysts who use BPMN regularly will expect them at the end of each process and/or sequence. f. Save the project. It should look like the screenshot below. There should be no errors in the Problems view.