Sun Adapter for Oracle Tutorials

ProcedureCreate the bpInsert Business Rules

  1. Double-click bpInsert in the Projects window to open the Business Process Designer to the bpInsert Business Process.

  2. Create the bpInsert FileClient.receive -> FileClient.write rule.

    1. Add a Business Rule to the link between FileClient.receive and FileClient.write and double-click the new Business Rule icon to open the Business Rule Designer.

    2. From the Business Rule Designer toolbar String menu, select string literal.

    3. Enter Inserting records into db_employee table..as the String value in the string literal method box.

    4. Map the Inserting records into db_employee table.. output node of the string literal method box, to text under FileClient.write.input in the Input pane (right pane) of the Business Rule Designer.

  3. Create the bpDelete FileClient.write -> otdInputDTD_DB_employee.unmarshal rule.

    1. Add a Business Rule to the link between FileClient.write and otdInputDTD_DB_employee.unmarshal and double-click the new Business Rule icon.

      The Business Rule Designer opens to the new Business Rule.

    2. Map text under FileClient.receive.Output in the Output pane of the Business Rule Designer, to contents under otdInputDTD_DB_employee.unmarshal.Input in the Input pane of the Business Rule Designer.

  4. Create the otdInputDTD_DB_employee.unmarshal -> Insert (Scope) element rule.

    1. Add a Business Rule to the link between otdInputDTD_DB_employee.unmarshal and the Insert (Scope) element and double-click the new Business Rule icon.

      The Business Rule Designer opens to the new Business Rule.

    2. From the Business Rule Designer toolbar Nodes menu, select count.

      A count method box is added to the Business Rule Designer canvas.

    3. Map the X_sequence_A under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee in the Output pane of the Business Rule Designer, to the node-set1 input node of the count method box.

    4. Map the return number output node of the count method box, to value under Total_count in the Input pane of the Business Rule Designer.

    5. From the Business Rule Designer toolbar Number menu, select number literal.

      A number literal method box is added to the Business Rule Designer canvas.

    6. Double-click the number literal method box value field, and enter 1.0 as the value.

    7. Map the 1.0 output node of the number literal method box, to value under Index_count in the Input pane of the Business Rule Designer.

      Image shows the bpInsert otdInputDTD_DB_employee.unmarshal
-> Insert rule as described in context.
  5. Create the X_sequence_A[number(getContainerData('Index_count'.'value'.'/value'))] predicate for the DTD.

    1. Right-click otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> x_sequence_A, and select New Predicate from the popup menu.

      The Predicate window appears

    2. From the Predicate window's Number menu, select number.

      A number method box is added to the Predicate window canvas.

    3. Map value under Index_count in the Business Process Attributes pane of the Predicate window, to the object1? input node of the number method box.

    4. Map the Return Number output node of the number method box, to Result in the right pane of the Predicate window.

    5. Click OK.

      The X_sequence_A[number(getContainerData('Index_count'.'value'.'/value'))] predicate is added to the Output pane of the Business Rule Designer under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee.

  6. Create the While -> otdOracle.DB_EMPLOYEEInsert rule.

    1. Add a Business Rule to the link between While input node and the otdOracle.DB_EMPLOYEEInsert and double-click the new Business Rule icon.

    2. From the Business Rule Designer toolbar Number menu, select Settings.

      The Method Pallette appears.

    3. From the Method Palette, click the Number tab and select the number option. Click Close.

      The number option is added to the Number menu.

    4. From the Business Rule Designer toolbar Number menu, select number.

      A number method box is added to the canvas.

    5. Map EmpNo under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> X_sequence_A[number(getContainerData(´‘Index_count'.‘value'.‘/value'))] in the Output pane of the Business Rule Designer, to the object1? input node of the number method box.

    6. Map the return number output node of the number method box, to EMP_NO under otdOracle.DB_EMPLOYEEInsert.Input -> input in the Input pane of the Business Rule Designer.

    7. From the Business Rule Designer toolbar Number menu, select number to add another number method box.

    8. Map Rate under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> X_sequence_A[number(getContainerData(´‘Index_count'.‘value'.‘/value'))] in the Output pane of the Business Rule Designer, to the object1? input node of the number method box.

    9. Map the return number output node of the number method box, to RATE under otdOracle.DB_EMPLOYEEInsert.Input -> input in the Input pane of the Business Rule Designer.

    10. Map Lastname under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> X_sequence_A[number(getContainerData(´‘Index_count'.‘value'.‘/value'))] in the Output pane of the Business Rule Designer, to LAST_NAME under otdOracle.DB_EMPLOYEEInsert.Input -> input in the Input pane of the Business Rule Designer.

    11. Map Firstname under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> X_sequence_A[number(getContainerData(´‘Index_count'.‘value'.‘/value'))] in the Output pane of the Business Rule Designer, to FIRST_NAME under otdOracle.DB_EMPLOYEEInsert.Input -> input in the Input pane of the Business Rule Designer.

    12. Map LastDate under otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> X_sequence_A[number(getContainerData(´‘Index_count'.‘value'.‘/value'))] in the Output pane of the Business Rule Designer, to LAST_UPDATE under otdOracle.DB_EMPLOYEEInsert.Input -> input in the Input pane of the Business Rule Designer.

      Image displays the While -> otdOracle.DB_EMPLOYEEInsert
Business Process as described in context.
  7. Create the otdOracle.DB_EMPLOYEEInsert -> While rule.

    1. Add a Business Rule to the link between the otdOracle.DB_EMPLOYEEInsert activity and the While output node and double-click the new Business Rule icon.

    2. From the Business Rule Designer toolbar Operator menu, select addition.

      A addition method box is added to the canvas.

    3. Map value under Index_count in the Output pane of the Business Rule Designer, to the number1 input node of the addition method box.

    4. Double-click the number2 field of the addition method box and enter a value of 1.0

    5. Map the return number output node of the addition method box, to value under Index-count in the Input pane of the Business Rule Designer.

  8. Create the Insert -> FileClient.write rule.

    1. Add a Business Rule to the link between the Insert output node and FileClient.write and double-click the new Business Rule icon.

    2. From the Business Rule Designer toolbar String menu, select string literal.

    3. Enter Insert Done as the String value.

    4. Map the Insert Done output node of the string literal method box, to text under FileClient.write.Input1 in the Input pane of the Business Rule Designer.