You can create the jcdTableSelect Java Collaboration business rules by following the steps below, or by copying the jcdTableSelect Collaboration Java Code into the Collaboration Editor's Java Source Editor as described in Using the Collaboration Editor's Java Source Editor.
From the Project window, double-click the jcdTableSelect Collaboration under your project's jcdALL node.
The Java Collaboration Editor opens to the jcdTableSelect Collaboration.
Create the Copy "Selectiong records from db_employee table via Table Select........" to FileClient_1.Text rule.
Click the rule icon on the Business Rules toolbar to add a new rule in the Business Rules pane.
From the Business Rules Designer toolbar's String menu, select Literal String.
A String method box is added to the Business Rules Designer canvas.
Double-click the value field of the String method box and enter Selectiong records from db_employee table via Table Select........ as the value.
Map the output node of the String method box, to Text, under FileClient_1 in the right pane of the Business Rules Designer.
Create the FileClient_1.write rule.
Click the rule icon on the Business Rules toolbar to add a new rule in the Business Rules pane.
Right-click the FileClient_1 node in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select and double-click write() from the method selection window.
The write method box appears in the Business Rules Designer canvas. The FileClient_1.write rule is added to the Business Rules tree.
Create the otdInputDTD_DB_Employee_1.unmarshalFromString(input.Text) rule.
Click the rule icon on the Business Rules toolbar to add a new rule in the Business Rules pane.
Right-click DB_EMPLOYEE under otdDB2_1 in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select select(String where) from the method selection window.
The select method box appears in the Business Rules Designer canvas, and a link connects the DB_EMPLOYEE node in the left pane of the Business Rules Designer to the DB_EMPLOYEE input node of the select method box.
Map Text under the input node in the left pane of the Business Rules Designer, to the where (String) input node of the select method box.
Add a While statement and create the condition: otdDB2_1.DB_EMPLOYEE.next rule.
Click the While icon on the Business Rules toolbar to add a While statement to the Business Rules tree.
Right-click DB_EMPLOYEE under otdDB2_1 in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select next() from the method selection window.
The next method box appears in the Business Rules Designer canvas, and a link connects the DB_EMPLOYEE node in the left pane of the Business Rules Designer to the DB_EMPLOYEE input node of the next method box.
Map the result (boolean) output node of the next method box, to the While condition in the right pane of the Business Rules Designer.
Create the Copy shortToString(otdDB2_1.DB_EMPLOYEE.EMP_NO) to otdOutputDTD_DB_employee_1.EmpNo rule beneath the While -> rules node.
Select the rules node under the While statement on the Business Rules tree, and click the rule icon on the Business Rules toolbar to add a new rule.
Map the EmpNo node, under otdDB2_1 -> DB_EMPLOYEE in the left pane of the Business Rules Designer, to Emp_No node, under otdOutputDTD_DB_employee_1 in the right pane of the Business Rules Designer.
The Business Rules Designer adds the necessary code for shortToString type conversion.
Create the Copy otdDB2_1.DB_EMPLOYEE.LAST_NAME to otdOutputDTD_DB_employee_1.Lastname rule under the last rule.
Create the Copy otdDB2_1.DB_EMPLOYEE.FIRST_NAME to otdOutputDTD_DB_employee_1.Firstname rule under the last rule.
Create the Copy otdDB2_1.DB_EMPLOYEE.RATE.toString to otdOutputDTD_DB_employee_1.Rate rule under the last rule.
Click the rule icon on the Business Rules toolbar to add a new rule.
Right-click the RATEnode, under otdDB2_1 -> DB_EMPLOYEE in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select toString() from the method selection window.
The toString method box appears in the Business Rules Designer canvas, and a link connects the RATE node in the left pane of the Business Rules Designer to the BigDecimal input node of the toString method box.
Map the result (String) output node of the toString method box to the Rate node, under otdOutputDTD_DB_employee_1 in the right pane of the Business Rules Designer.
Create the Copy dateToString(otdDB2_1.DB_EMPLOYEE.LAST_UPDATE) to otdOutputDTD_DB_employee_1.LastDate rule.
Click the rule icon on the Business Rules toolbar to add a new rule.
Map the LAST_UPDATE node, under otdDB2_1 -> DB_EMPLOYEE in the left pane of the Business Rules Designer, to LastDate node, under otdOutputDTD_DB_employee_1 in the right pane of the Business Rules Designer.
The Business Rules Designer adds the necessary code for dateToString type conversion.
Create the Copy otdOutputDTD_DB_employee_1.marshalToString to FileClient_1.Text rule under the last rule.
Click the rule icon on the Business Rules toolbar to add a new rule.
Right-click otdOutputDTD_DB_employee_1 in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select marshalToString() from the method selection window.
The marshalToString method box appears in the Business Rules Designer canvas, and a link connects otdOutputDTD_DB_employee_1 in the left pane of the Business Rules Designer to the DB_employee input node of the marshalToString method box.
Map the result (String) output node of the marshalToString method box to the Text node, under FileClient_1 in the right pane of the Business Rules Designer.
Create the FileClient_1.write rule.
Click the rule icon on the Business Rules toolbar to add a new rule.
Right-click the FileClient_1 node in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select and double-click write() from the method selection window.
The write method box appears in the Business Rules Designer canvas. The FileClient_1.write rule is added to the Business Rules tree.
Create the Copy "Table Select Done." to FileClient_1.Text rule.
From the Business Rules tree, select the While statement, then click the rule icon on the Business Rules toolbar to add a new rule.
A new rule is added to the main trunk of the Business Rules tree.
From the Business Rules Designer toolbar's String menu, select Literal String.
A String method box is added to the Business Rules Designer canvas.
Double-click the value field of the String method box and enter Table Select Done. as the value.
Map the output node of the String method box, to Text, under FileClient_1 in the right pane of the Business Rules Designer.
Create the FileClient_1.write rule.
Click the rule icon on the Business Rules toolbar to add a new rule in the Business Rules pane.
Right-click the FileClient_1 node in the left pane of the Business Rules Designer, and choose Select method to call from the popup menu.
The method selection window appears.
Select and double-click write() from the method selection window.
The write method box appears in the Business Rules Designer canvas. The FileClient_1.write rule is added to the Business Rules tree.
Click Save All to save your current changes.
The completed jcdTableSelect Collaboration definition appears as follows: