The bpInsert Business Process implements the Input Operation to read the TriggerInsert.in. file. It then unmarshals data from the input data into the otdInputDTD_DBEmployees OTD, calls the otdOracle, and inserts records into the database, and writes a message to confirm an inserted record.
Double-click bpInsert in the Projects window to open the Business Process Designer to the bpInsert Business Process.
Create the bpInsert FileClient.receive -> FileClient.write rule.
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.
From the Business Rule Designer toolbar String menu, select string literal.
Enter Inserting records into db_employee table..as the String value in the string literal method box.
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.
Create the bpDelete FileClient.write -> otdInputDTD_DB_employee.unmarshal rule.
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.
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.
Create the otdInputDTD_DB_employee.unmarshal -> Insert (Scope) element rule.
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.
From the Business Rule Designer toolbar Nodes menu, select count.
A count method box is added to the Business Rule Designer canvas.
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.
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.
From the Business Rule Designer toolbar Number menu, select number literal.
A number literal method box is added to the Business Rule Designer canvas.
Double-click the number literal method box value field, and enter 1.0 as the value.
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.
Create the X_sequence_A[number(getContainerData('Index_count'.'value'.'/value'))] predicate for the DTD.
Right-click otdInputDTD_DB_employee.unmarshal.Output -> DB_employee -> x_sequence_A, and select New Predicate from the popup menu.
The Predicate window appears
From the Predicate window's Number menu, select number.
A number method box is added to the Predicate window canvas.
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.
Map the Return Number output node of the number method box, to Result in the right pane of the Predicate window.
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.
Create the While -> otdOracle.DB_EMPLOYEEInsert rule.
Add a Business Rule to the link between While input node and the otdOracle.DB_EMPLOYEEInsert and double-click the new Business Rule icon.
From the Business Rule Designer toolbar Number menu, select Settings.
The Method Pallette appears.
From the Method Palette, click the Number tab and select the number option. Click Close.
The number option is added to the Number menu.
From the Business Rule Designer toolbar Number menu, select number.
A number method box is added to the canvas.
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.
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.
From the Business Rule Designer toolbar Number menu, select number to add another number method box.
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.
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.
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.
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.
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.
Create the otdOracle.DB_EMPLOYEEInsert -> While rule.
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.
From the Business Rule Designer toolbar Operator menu, select addition.
A addition method box is added to the canvas.
Map value under Index_count in the Output pane of the Business Rule Designer, to the number1 input node of the addition method box.
Double-click the number2 field of the addition method box and enter a value of 1.0
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.
Create the Insert -> FileClient.write rule.
Add a Business Rule to the link between the Insert output node and FileClient.write and double-click the new Business Rule icon.
From the Business Rule Designer toolbar String menu, select string literal.
Enter Insert Done as the String value.
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.