Pages

Sunday, January 13, 2008

ADF taskflow method call with complex return types

In one of my projects I used a bounded taskflow where I called a bpel web service with a taskflow method call which had a complex return type. You have to do something more to evaluate the results then I described in this blog.

Process is the method call with its own pagedef. In the router I check the return status attribute so it knows to return the taskflow with a succes or abort.
To call the bpel web service I use an ADF web service datacontrol. This generates a datacontrol see picture below.
Now we can drag the process method of the creditcheck datacontrol to the taskflow. We get the following wizard where we can define the values of the input variables.

It generates the following pagedef.

 
MethodName="process" IsViewObjectMethod="false"
DataControl="CreditCheck" InstanceName="CreditCheck"
ReturnName="CreditCheck.methodResults.process_CreditCheck_process_result">
NDValue="${data.items_trainPageDef.CustomerId.inputValue}"
NDType="java.lang.Integer"/>
NDValue="${data.items_trainPageDef.OrderId.inputValue}"
NDType="java.lang.Integer"/>
NDValue="${data.items_trainPageDef.OrderTotal.inputValue}"
NDType="java.lang.Float"/>


The return = CreditCheck.methodResults.process_CreditCheck_process_result. To evaluate the status we must add a methoditerator on the result. We do this in the pagedef.
Now we can add the status attributevalue to pagedef.We have to click "add" button to generate an accessorIterator first
Now we select the process_Result of the process method
We return to the create attribute binding dialog and now we can select the status attribute. The method call pagedef looks like this
 
version="11.1.1.47.96"
id="WEB_INF_order_task_flow_definition_order_task_flow_definition_process"
Package="nl.ordina.order.view.pageDefs">


RangeSize="25"
BeanClass="nl.ordina.order.view.CreditCheck.process"
id="processIterator"/>
RangeSize="25" DataControl="CreditCheck"
BeanClass="nl.ordina.order.view.CreditCheck.process_Result"
id="process_ResultIterator"/>


MethodName="process" IsViewObjectMethod="false"
DataControl="CreditCheck" InstanceName="CreditCheck"
ReturnName="CreditCheck.methodResults.process_CreditCheck_process_result">
NDValue="${data.items_trainPageDef.CustomerId.inputValue}"
NDType="java.lang.Integer"/>
NDValue="${data.items_trainPageDef.OrderId.inputValue}"
NDType="java.lang.Integer"/>
NDValue="${data.items_trainPageDef.OrderTotal.inputValue}"
NDType="java.lang.Float"/>









Now we can use the status attributevalue in the router. If status is true then the outcome is succes else the default outcome is used ( abort)

No comments:

Post a Comment