With the new soa suite patch ( 4 feb ) for the jdeveloper 11g TP3 release we can test the business rules. The 11g version is a totally different then the 10.1.3 version. The first thing is a lot easier to make business rules and you can expose these rules as web services so you can use it in other applications. In 10.1.3 you have a binary br repository which you can use. Now you create service in the BR to expose a particular ruleset or function. You can also use business rules to create advanced approval routing in the workflow component.
The first step is to drag the business rule to the composite.xml. Now you get a wizard to create a new business rule. In my case I made a simple schema with a element total order amount which I use as input and as output boolean element supersize order. You can also check expose as composite service so you can use this br in other applications
Because I checked the expose as composite service you can see that soa suite creates a webservice.
If we open the new BR then we see that soa suite has created xml facts of the input and output element. This is done with jaxb.
Soa suite also creates a service which calls the empty created ruleset. You can add more services based on br functions or other rulesets.
To the created the ruleset we can add a new rule. We select a simple test where we check if the total order is greater then 2000.
Next I select the input element, > and 2000. Now we can add the return value. Choose assert new.
We have to select the output element and in the output element we select true. Now we can make a second rule where the outcome is false when the input is lower then 2000
We are ready with the composite part now we can go to bpel where we add a business rule to the right place in the bpel designer. We have to select the just created br and the right operation, in my case assert facts , execute and retrieve result. We also have to assign the input and output variable of the br.
This is how it looks when we open the business rule scope.
You are ready to deploy this to soa container and test this