Sun Adapter for DB2 Tutorials

Creating the bpTableSelect Business Rules

The bpTableSelect business process describes how to select all records the DB2 database using the Business Process Designer.


Note –

The where clause in the business rule reads the trigger value as a placeholder for input. This permits you to modify the query to select a specific record. Also note that all records are selected from the database when the TriggerTableSelect.in file is empty.


ProcedureCreate the bpTableSelect Business Rules

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

  2. Create the bpTableSelect 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. Create a string literal and enter Selecting record(s) from db_employee table via table select...as the String value.

    3. Map the Selecting record(s) from db_employee table via table select... 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 FileClient.write -> otdDB2.DB_EMPLOYEESelectAll rule.

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

    2. Map text under FileClient.receive.Output in the Output pane of the Business Rule Designer, to the whereClause under otdDB2.DB_EMPLOYEESelectAll.Input in the Input pane.

  4. Create the otdDB2.DB_EMPLOYEESelectAll -> otdInputDTD_DBemployees.marshal rule.

    1. Add a Business Rule to the link between otdDB2.DB_EMPLOYEESelectAll and otdInputDTD_DBemployees.marshal and double-click the new Business Rule icon to open the Business Rule Designer.

    2. Map nodes under otdDB2.Select_psPSSelectAll.Output -> output -> DB_EMPLOYEESelectAllTableResponseTypeList in the Output pane of the Business Rule Designer, to the corresponding nodes under otdInputDTD_DBemployees.marshal.Input -> DBemployees -> X_sequence_A in the Input pane of the Business Rule Designer, as follows:

      • EMP_NO -> EmpNo

      • LAST_NAME -> Lastname

      • FIRST_NAME -> Firstname

      • RATE -> Rate

      • LAST_UPDATE -> LastDate

  5. Create the otdInputDTD_DBemployees.marshal -> FileClient.write rule.

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

    2. Map text under otdInputDTD_DBemployees.marshal.Output in the Output pane of the Business Rule Designer, to text under FileClient.write.Input1 in the Input pane.

  6. Create the FileClient.write -> FileClient.write rule.

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

    2. Create a string literal and enter TableSelect Done...as the String value.

    3. Map the TableSelect Done... output node of the string literal method box, to text under FileClient.write.input2 in the Input pane (right pane) of the Business Rule Designer.