uCosminexus Service Platform, First Step Guide User's Guide and Operator's Guide

[Contents][Glossary][Index][Back][Next]

5.5.3 Defining the product arrangement business process

The product arrangement business process of the HelloProductArrangement sample program executes processing as follows:

  1. The product arrangement business process receives the product name and quantity entered from the service requester.
  2. The stock management service is called via the stock management service adapter.
  3. When the stock management service is called, if the product is out of stock, an asterisk (*), which means out of stock, is returned to the service requester.
  4. If the product is in stock, the delivery number is obtained by calling the delivery reception service via the delivery reception service adapter.
  5. The obtained delivery number is returned to the service requester.

Note that because the product arrangement business process is called by using a user-defined reception, you need to create a user-defined reception by using WSDL (ArrangementService.wsdl).

Define a business process of the HelloProductArrangement sample program as follows:

  1. Add a new business process.
  2. Add a user-defined reception.
  3. Set variables.
  4. Deploy activities.
  5. Define activities.
  6. Finish defining the business process.
Organization of this subsection
(1) Adding a business process
(2) Adding a user-defined reception
(3) Setting variables
(4) Deploying activities
(5) Defining activities

(1) Adding a business process

The following table shows the values that you need to set when adding the product arrangement business process.

Table 5-7 Values that need to be set when adding a business process

Item Value to be set Description
Business process name ProductArrangement Specify the name of the business process.
Status persistence yes Specify whether to leave records in the database. The records left in the database can be used to check the progress of a process. For this sample program, you leave records in the database. Therefore, select yes.
Import check box in the BPEL file area Clear the check box. To import the BPEL file that was created by using a tool in the upper process, select the check box. If you import the file, the activities necessary for the business process are automatically displayed. For this sample program, you do not import the file. Therefore, clear the check box.
Service ID ArrBP Specify the ID of the business process.

The following is the procedure for adding the product arrangement business process.

  1. In the tree view, select and right-click Service Definition List, and then select Add Business Process.
    The dialog box for adding a business process definition appears.
  2. Enter ProductArrangement in Business Process Name, and then select yes for Status Persistence. Clear the Import check box in the BPEL file area.

    [Figure]

  3. Click the Finish button.
    A business process named ProductArrangement is created, and then the Define Business Process window appears.
  4. In the tree view, select Product Arrangement.
    A list of properties for the ProductArrangement business process is displayed in the properties view.
  5. In the properties view, click the cell for the value of the service ID.
    A value can be entered in the cell.
  6. Change the value to ArrBP, and then press the Enter key.

    [Figure]

  7. When a message asking you whether you really want to change the value appears, click the OK button.

(2) Adding a user-defined reception

The HelloProductArrangement sample program receives a request from the service requester by using a reception that has been defined by the user according to the interface of the business process. The interface of the business process includes the operation name and message format to be set for the receive activity and reply activity. The following table shows the values that you need to set when adding a user-defined reception.

Table 5-8 Values that need to be set when adding a user-defined reception

Item Value to be set Description
Reception type SOAP Reception Select the reception type.
Reception name ServiceReception Specify the name of the user-defined reception.
WSDL file ArrangementService.wsdl Specify the name of the WSDL file to be used.
Port name Arrangement Specify the port name.

Note:
For details about the location of the file, see A.3 Configuration of the HelloProductArrangement sample program.

  

The following is the procedure for adding a user-defined reception for product arrangement.

  1. In the tree view, select and right-click the Product Arrangement business process, and then select Add User Defined Reception.

    [Figure]

    The dialog box for selecting the reception type appears.
  2. From the Reception type drop-down list, select SOAP Reception.

    [Figure]

  3. Click the Next button.
    The dialog box for adding the SOAP reception appears.
  4. Enter ServiceReception as the reception name, and then specify ArrangementService.wsdl as the WSDL file.

    [Figure]

  5. Click the Next button.
  6. From the drop-down list, select Arrangement, and then click the Finish button.

    [Figure]

    The SOAP reception is added to the business process, and then the window for defining a user-defined reception appears.

    [Figure]

(3) Setting variables

For a business process, variables are used to define activities. Therefore, the variables to be used must be set before activities are defined. The following table shows the variables to be used for the product arrangement business process.

Table 5-9 Variables to be used for the product arrangement business process

Variable name Type XSD file
InputData XML InputData.xsd
OutputData XML OutputData.xsd
StockAllocationInputData XML StockAllocationInputData.xsd
StockAllocationOutputData XML StockAllocationOutputData.xsd
DeliveryArrangementInputData XML DeliveryArrangementInputData.xsd
DeliveryArrangementOutputData XML DeliveryArrangementOutputData.xsd

The following is the procedure for setting the variables to be used for the product arrangement business process.

  1. On the canvas of the Define Business Process window, double-click the Variable-Correlation icon.
    The List Of Variables And Correlation Sets dialog box appears.
  2. Select Variable List. Enter InputData in Variable name, and then select XML from the Type drop-down list.
  3. Click the Take In button.
    The Take In Message Format dialog box appears.
  4. Select Reception name, and then, from the drop-down list, select Service Reception.
  5. Select arrangeItem from the Operation name drop-down list, and Request message (Body) from the Message type drop-down list. For Message format, enter InputData.

    [Figure]

  6. Click the OK button.
    The Take In Message Format dialog box closes.
  7. In the List Of Variables And Correlation Sets dialog box, click the Add button.
    The InputData variable is added to the Variable List node.
  8. In the same way as steps 2 to 7, set the variables OutputData, StockAllocationInputData, StockAllocationOutputData, DeliveryArrangementInputData, and DeliveryArrangementOutputData.
    The values to be set are as follows.
    All of the types set in the List Of Variables And Correlation Sets dialog box are XML. The values to be set in the Take In Message Format dialog box are as follows.
    Item Variable name
    OutputData StockAllocationInputData StockAllocationOutputData DeliveryArrangementInputData DeliveryArrangementOutputData
    Service/Reception Reception name Service name Service name Service name Service name
    Name of Service/Reception ServiceReception StockManagement StockManagement DeliveryReception DeliveryReception
    Operation name arrangeItem reserveItem reserveItem deliverItem deliverItem
    Message type Response message (Body) Request message (Body) Response message (Body) Request message (Body) Response message (Body)
    Message format Output data Stock allocation input data Stock allocation output data Delivery arrangement input data Delivery arrangement output data
  9. In the List Of Variables And Correlation Sets dialog box, click the OK button.
    The variables are now set.

    [Figure]

(4) Deploying activities

The following table shows the activities that are necessary for the business process of the HelloProductArrangement sample program.

Table 5-10 Activities necessary for the business process of the HelloProductArrangement sample program

Value to be set Description
Receive activity Receives a response from the service requester
Data transformation activity Edits input data, output data, stock allocation data, and delivery arrangement data
Invoke service activity Calls the stock management service or delivery reception service
Switch start activity Starts the processing selected according to the condition (whether the product is in stock)
Reply activity Returns the processing result to the service requester
Switch end activity Ends the processing selected according to the condition (whether the product is in stock)

The following shows the activity deployment procedure.

  1. Place activities on the canvas as shown in the following figure. To place an activity, click on it on the palette, and then click the position at which to place it on the canvas.

    [Figure]

  2. To connect activities, click Connection on the palette.
  3. Click the start activity to start the connection.
  4. Click the receive activity as the connection destination.
    The start activity is now connected to the receive activity.
  5. Chain the activities by connecting adjacent ones (as in steps 2 to 4) from the receive activity to the end activity.
    Make sure that the activities are chained as follows.

    [Figure]

(5) Defining activities

Define each of the activities that were placed on the canvas.

(a) Receive activity
  1. Double-click the receive activity (ReceiveActivity1) on the canvas.
    The Receive Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name Receive Enter the name of the activity.
    Operation name arrangeItem Specify the name of the operation that is used to call the stock management service from the service requester.
    Body allocated variable InputData From the drop-down list, select the variable to be allocated to the body of the request message for the business process.
    Header allocated variable None Set this item when you allocate a variable to the header of the request message for the business process. This item is not used for this sample program. Therefore, do not set this item.
    Correlation set group None Set this item when you allocate a correlation set group to an activity. This item is not used for this sample program. Therefore, do not set this item.
    Communication model Sync Specify the communication model of the operation. The product arrangement service used for this sample program is a Web Service. Therefore, set Sync.
    Instance generation yes Select whether to initialize the process when a request message is received. For this sample program, set yes to enable initialization.
  3. Click the OK button.
(b) Data transformation activity (for preprocessing of stock allocation)
  1. Double-click the data transformation activity (DataActivity1) on the canvas.
    The Data Transformation Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name StockAllocationPreprocessing Enter the name of the activity.
    Variable (in the Source Variables area) InputData Select the transformation-source variable from the drop-down list, and then click the Add button.
    Variable (in the Destination Variable area) StockAllocationInputData Select the transformation-destination variable from the drop-down list.
    DataTransDefnFile StockAllocationPreprocessing Enter the name of the data transformation definition file to be used to transform variables.
  3. Click the OK button.
  4. Right-click the data transformation activity on the canvas, and then select Launch mapping definition.
    The Select Root Element dialog box appears.
  5. Click the root element of InputData (schema logical name) for Source, and then, from the drop-down list, select ars:arrangeItem.
  6. Click the root element of StockAllocationInputData (schema logical name) for Destination, and then, from the drop-down list, select ims:reserveItem.

    [Figure]

  7. Click the OK button.
    The data transformation definition window appears.
  8. On the palette of the data transformation definition window, select Mapping.

    [Figure]

  9. Click the node adapter of the transformation-source node as the mapping source.
  10. Click the node adapter of the transformation-destination node as the mapping-destination.
    A mapping line is set. The correspondence between the mapping-source and mapping-destination node adapters is as follows.

    [Figure]

(c) Data transformation activity (in the case where the product is out of stock)
  1. Double-click the data transformation activity (DataActivity2) on the canvas.
    The Data Transformation Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name Out-Of-Stock-Setting Enter the name of the activity.
    Variable (in the Source Variables area) StockAllocationOutputData Select the transformation-source variable from the drop-down list, and then click the Add button.
    Variable (in the Destination Variable area) OutputData Select the transformation-destination variable from the drop-down list.
    DataTransDefnFile Out-Of-Stock-Setting Enter the name of the data transformation definition file to be used to transform variables.
  3. Click the OK button.
  4. Right-click the data transformation activity on the canvas, and then select Launch mapping definition.
    The Select Root Element dialog box appears.
  5. Click the root element of StockAllocationOutputData (schema logical name) for Source, and then, from the drop-down list, select ims:reserveItemResponse.
  6. Click the root element of OutputData (schema logical name) for Destination, and then, from the drop-down list, select ars:arrangeItemResponse.

    [Figure]

  7. Click the OK button.
    The data transformation definition window appears.
  8. On the palette of the data transformation definition window, select Mapping.

    [Figure]

  9. Click the node adapter of the transformation-source node as the mapping source.
  10. Click the node adapter of the transformation-destination node as the mapping-destination.
    A mapping line is set. The correspondence between the mapping-source and mapping-destination node adapters is as follows.

    [Figure]

(d) Data transformation activity (for preprocessing of delivery arrangement)
  1. Double-click the data transformation activity (DataActivity3) on the canvas.
    The Data Transformation Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name DeliveryArrangementPreprocessing Enter the name of the activity.
    Variable (in the Source Variables area) StockAllocationOutputData Select the transformation-source variable from the drop-down list, and then click the Add button.
    Variable (in the Destination Variable area) DeliveryArrangementInputData Select the transformation-destination variable from the drop-down list.
    DataTransDefnFile DeliveryArrangementPreprocessing Enter the name of the data transformation definition file to be used to transform variables.
  3. Click the OK button.
  4. Right-click the data transformation activity on the canvas, and then select Launch mapping definition.
    The Select Root Element dialog box appears.
  5. Click the root element of StockAllocationOutputData (schema logical name) for Source, and then, from the drop-down list, select ims:reserveItemResponse.
  6. Click the root element of DeliveryArrangementInputData (schema logical name) for Destination, and then, from the drop-down list, select dls:deliverItem.

    [Figure]

  7. Click the OK button.
    The data transformation definition window appears.
  8. On the palette of the data transformation definition window, select Mapping.

    [Figure]

  9. Click the node adapter of the transformation-source node as the mapping source.
  10. Click the node adapter of the transformation-destination node as the mapping destination.
    A mapping line is set. The correspondence between the mapping-source and mapping destination node adapters is as follows.

    [Figure]

(e) Data transformation activity (for setting a delivery number)
  1. Double-click the data transformation activity (DataActivity4) on the canvas.
    The Data Transformation Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name DeliveryNumberSetting Enter the name of the activity.
    Variable (in the Source Variables area) DeliveryArrangementOutputData Select the transformation-source variable from the drop-down list, and then click the Add button.
    Variable (in the Destination Variable area) OutputData Select the transformation-destination variable from the drop-down list.
    DataTransDefnFile DeliveryNumberSetting Enter the name of the data transformation definition file to be used to transform variables.
  3. Click the OK button.
  4. Right-click the data transformation activity on the canvas, and then select Launch mapping definition.
    The Select Root Element dialog box appears.
  5. Click the root element of DeliveryArrangementOutputData (schema logical name) for Source, and then, from the drop-down list, select dls:deliverItemResponse.
  6. Click the root element of OutputData (schema logical name) for Destination, and then, from the drop-down list, select ars:arrangeItemResponse.

    [Figure]

  7. Click the OK button.
    The data transformation definition window appears.
  8. On the palette of the data transformation definition window, select Mapping.

    [Figure]

  9. Click the node adapter of the transformation-source node as the mapping source.
  10. Click the node adapter of the transformation-destination node as the mapping destination.
    A mapping line is set. The correspondence between the mapping-source and mapping destination node adapters is as follows.

    [Figure]

(f) Invoke service activity (for stock allocation)
  1. Double-click the invoke service activity (InvokeActivity1) on the canvas.
    The Invoke Service Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name StockAllocation Enter the name of the activity.
    Service name StockManagement From the drop-down list, select the name of the service component to be called by sending a request message.
    Operation name reserveItem Among the operations for the service component (stock management) specified in Service name, select the name of the operation that is to be called.
    Communication model Sync The communication model set for the operation specified in Operation name is displayed.
    Body allocated variable (in the Request message area) StockAllocationInputData From the drop-down list, select the variable to be allocated to the body of the request message that calls the stock management service.
    Header allocated variable (in the Request message area) None Set this item when you allocate a variable to the header of the request message that calls the stock management service. This item is not used for this sample program. Therefore, do not set this item.
    Body allocated variable (in the Response message area) StockAllocationOutputData From the drop-down list, select the variable to be allocated to the body of the response message to be received from the synchronization operation.
    Header allocated variable (in the Response message area) None Set this item when you allocate a variable to the header of the response message to be received from the synchronization operation. This item is not used for this sample program. Therefore, do not set this item.
    Correlation set group None Set this item when you allocate a correlation set group to an activity. This item is not used for this sample program. Therefore, do not set this item.
  3. Click the OK button.
(g) Invoke service activity (for delivery arrangement)
  1. Double-click the invoke service activity (InvokeActivity2) on the canvas.
    The Invoke Service Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name DeliveryArrangement Enter the name of the activity.
    Service name DeliveryReception From the drop-down list, select the name of the service component to be called by sending a request message.
    Operation name deliverItem Among the operations for the service component (delivery arrangement) specified in Service name, select the name of the operation that is to be called.
    Communication model Sync The communication model set for the operation specified in Operation name is displayed.
    Body allocated variable (in the Request message area) DeliveryArrangementInputData From the drop-down list, select the variable to be allocated to the body of the request message that calls the delivery arrangement service.
    Header allocated variable (in the Request message area) None Set this item when you allocate a variable to the header of the request message that calls the delivery arrangement service. This item is not used for this sample program. Therefore, do not set this item.
    Body allocated variable (in the Response message area) DeliveryArrangementOutputData From the drop-down list, select the variable to be allocated to the body of the response message to be received from the synchronization operation.
    Header allocated variable (in the Response message area) None Set this item when you allocate a variable to the header of the response message to be received from the synchronization operation. This item is not used for this sample program. Therefore, do not set this item.
    Correlation set group None Set this item when you allocate a correlation set group to an activity. This item is not used for this sample program. Therefore, do not set this item.
  3. Click the OK button.
(h) Reply activity (if the product is out of stock)
  1. Double-click the reply activity (ReplyActivity1) on the canvas.
    The Reply Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name Reply_Out-Of-Stock-Error Enter the name of the activity.
    Operation name arrangeItem Specify the name of the operation specified for the corresponding receive activity.
    Body allocated variable OutputData From the drop-down list, select the variable to be allocated to the body of the response message for the business process.
    Header allocated variable None Set this item when you allocate a variable to the header of the response message for the business process. This item is not used for this sample program. Therefore, do not set this item.
    Correlation set group None Enter this item when you allocate a correlation set group to an activity. This item is not used for this sample program. Therefore, do not set this item.
    Fault name None Define the reply activity as fault processing, and then specify the fault name to be used when a response message that indicates that a fault occurred in the service requester is received. No fault processing is used for this sample program. Therefore, do not set this item.
  3. Click the OK button.
(i) Reply activity (in the case where delivery arrangement is successful)
  1. Double-click the reply activity (ReplyActivity2) on the canvas.
    The Reply Activity dialog box appears.
  2. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Activity name Reply_Arrangement-Success Enter the name of the activity.
    Operation name arrangeItem Specify the name of the operation specified for the corresponding receive activity.
    Body allocated variable OutputData From the drop-down list, select the variable to be allocated to the body of the response message for the business process.
    Header allocated variable None Set this item when you allocate a variable to the header of the response message for the business process. This item is not used for this sample program. Therefore, do not set this item.
    Correlation set group None Enter this item when you allocate a correlation set group to an activity. This item is not used for this sample program. Therefore, do not set this item.
    Fault name None Define the reply activity as fault processing, and then specify the fault name to be used when a response message that indicates that a fault occurred in the service requester is received. No fault processing is used for this sample program. Therefore, do not set this item.
  3. Click the OK button.
(j) Switch start activity
  1. Double-click the switch start activity (SwitchStartActivity1) on the canvas.
    The Switch Activity dialog box appears.
  2. Enter CheckStockAllocationResult as the activity name.
  3. Click the line on which the value of the Transition destination column is Out-Of-Stock-Setting. Then, click the To Upper button to move the line to the top line.
  4. Select the top line, and then click the Condition Setting... button.
    The Set Condition dialog box appears.
  5. Enter information as shown in the following figure.

    [Figure]

    Item Value to be set Description
    Condition name Out-Of-Stock Specify the condition for determining whether the product is out of stock as a result of a stock allocation check.
    Variable contents StockAllocationOutputData From the drop-down list, select the variable to be used in the condition expression.
    Condition expression
    csc:getVariableData("StockAllocationOutputData", "/*[local-name()
    ='reserveItemResponse' and namespace-uri()
    ='http://sample/InventoryManagementService']/*[local-name()
    ='ReservationNumber' and namespace-uri()
    ='http://sample/InventoryManagementService']")="*"
    Specify the condition expression for determining whether the product is out of stock in XPath expression format.

    Note:
    Line breaks are not applied to the displayed condition expression.

  6. Click the OK button.
    The Switch Activity dialog box appears again.
  7. On the line on which the value of the Transition destination column is DeliveryArrangementPreprocessing, click Priority, and then select Default from the drop-down list.
    If you select Default, you do not need to specify the condition settings.

    [Figure]

  8. Click the OK button.
(k) Switch end activity
  1. Double-click the switch end activity (SwitchEndActivity1) on the canvas.
    The details of the switch end activity are displayed in the properties view.
  2. Enter CheckStockAllocationResult_End as the activity name.

    [Figure]

  3. When you have defined all activities, from the menu, select File and then Save. The business process is now defined.