This blog gives you a guide to do this. This example is a credit check if you put in the start page a value below 200 then it is approved and above 200 it is declined. The credit is done with a router and with a method call /router.
First we create a fusion project. Now we have an empty adfc-config.xml, this is the unbounded taskflow. In this taskflow I create 3 views start, approved and declined. On the pages approved and declined I only put in an outputtext with approved or declined.
This is the start page.
In the taskflow routing and in the start page I use the following simple backing bean.
I put this bean in the adfc-config as a pageFlow managed bean. The price variable is used for the start page inputtext and the isapproved method for the router priceCheck. We are ready to drop now a router on the adfc-config.xml
In this taskflow you are already see the web server method call. I will explain this later in this blog. Let's look at the properties of the router priceCheck.
The default outcome is declined, this value is used when StartPage.approved = false when this is true then the outcome is approved. We are ready with the router example.
Let's make it a little bit interesting by calling a web service which does the credit check. We make a new empty project in the same workspace. Make a java class with a method which has 1 parameter price and it returns true when the price is below 200 else false. Create a web service on this method and deploy this on the oc4j server in the jdeveloper home. We go back to the viewcontroller project where we create a web service datacontrol on this web service. We drop the created datacontrol on the taskflow. Now automatically a method call with a pagedef is created.
I only have to fill in the fixed outcome so the control flow case goes the router where the result of the ws is evaluated.
We have the store the result of the web service in a variable so the router can used it.
The router is almost the same as the first router. We are ready to test it.
Here you have the example project. To run it you have to deploy the web service to the jdeveloper oc4j server first.