Processing an Order in a Purchase Order System

ProcedureTo specify the business logic for the InventoryService BPEL process

  1. Specify the business logic for the If1 element (not the Assign1 element) from the BPEL Mapper as follows:

    1. Select the If1 element in the BPEL Designer's Design view, and click the Designer's Mapper button to open the BPEL Mapper.

      The If1 activity is displayed in the BPEL Mapper window.

    2. From the BPEL Mapper, expand the nodes in the Output pane.

    3. From the BPEL Mapper toolbar's String menu, select Starts With. The Starts With function box appears in the Mapping pane.

    4. Map the orderDescription node, under Variables -> IsInventoryAvailableIn -> purchaseOrder in the Output pane of the BPEL Mapper, to the first inbound String node of the Starts With function box. To do this, click on the orderDescription node, and drag your cursor to the String node of the Starts With function box. A link now joins the two nodes.

    5. From the BPEL Mapper toolbar's String menu, select String Literal. A String Literal function box appears in the Mapping pane. Enter OrderVal, as the String Literal value.

    6. Map the outbound OrderVal node of the String Literal function box to the inbound string2 node of the Starts With function box.

    7. Map the outbound Boolean node of the Starts With function box to the Boolean Condition node, under If1 in the Input pane of the BPEL Mapper.

      Graphic shows the BPEL Mapper as described in context.
  2. Specify the business logic for the Assign1 element from the BPEL Mapper as follows:

    1. From the BPEL Designer's Design view, select the Assign1 element and click the Mapper button to open the BPEL Mapper.

      The Assign1 activity is displayed in the BPEL Mapper window.

    2. Map orderId, under Variables -> IsInventoryAvailableIn -> purchaseOrder in the Output pane of the BPEL Mapper, to orderId, under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

    3. From the BPEL Mapper toolbar's Boolean menu, select and drag Logical True to the Mapping pane. Map the outbound Boolean node of the Logical True function box to inventoryStatus under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

    4. From the BPEL Mapper toolbar's String menu, select String Literal. A String Literal function box appears in the Mapping pane. Enter available, as the String Literal value.

    5. Map the outbound available node of the String Literal function box to inventoryStatusMessage, under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

      Graphic shows the BPEL Mapper as described in context.
  3. Add an Assign element to the Else of the If1 element in the process flow. To do this, drag-and-drop the Assign activity from the BPEL Designer Palette to the center of the ELSE branch of the If1 element. The Assign2 element is added to the InventoryService process flow.

    Graphic displays the Inventory Service process flow as
it is being assembled in the BPEL Designer. Described in context.
  4. Specify the business logic for the Assign2 element from the BPEL Mapper as follows:

    1. Select the Assign2 element in the BPEL Designer's Design view, and click the Designer's Mapper button to open the BPEL Mapper.

      The Assign2 activity is displayed in the BPEL Mapper window.

    2. From the BPEL Mapper, expand the nodes in the Output and Input panes.

    3. Map orderId, under Variables -> IsInventoryAvailableIn -> purchaseOrder in the Output pane of the BPEL Mapper, to orderId, under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

    4. From the BPEL Mapper toolbar's Boolean menu, drag Logical Falseto the center pane of the Designer, inline with the inventoryStatus node under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

      The Logical False function box appears in the Mapping pane.

    5. Map the outbound Boolean node of the Logical False function box, to the inventoryStatus node under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

    6. From the BPEL Mapper toolbar's String menu, select String Literal. Drag the String Literal function box inline with the inventoryStatusmessage node under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper and enter Not available, as the String Literal value.

    7. Map the outbound Not available node of the String Literal function box to inventoryStatusMessage under Variables -> IsInventoryAvailableOut -> inventoryStatus in the Input pane of the BPEL Mapper.

      Graphic shows the BPEL Mapper as described in context.
  5. Validate your new BPEL process as follows:

    1. From the BPEL Designer's toolbar, click the Validate XML button. Validation of the BPEL process is performed. The results of the validation are displayed in the NetBeans IDE Output window.

    2. If the validation process finds any errors, the Output window lists each error with a link to the point of error in the BPEL Designer. Double-click the hyperlink and refer to the error message for information on how to resolve the error.

    3. Once you have resolved any errors, run validation again to ensure that there are no remaining errors or warnings.

    4. Click Save All to save your changes.