Sunday, June 05, 2011

Business Rules-BucketSets in SOA Suite 11g

Bucketset is a set of list of values or a list of ranges to specify constraint for your business rules.
It helps you to validate your data against the predefined set of values in the list of value or list of ranges.
It also help to put a constraint on your function argument and return values.
In this exercise we will try to create a simple bucketset and will try to know more about its functionality.

There are various documents which you can refer in order to get more knowledge on bucket sets.

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/intro.htm#ASRUG223

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/facts.htm#ASRUG257

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/facts.htm#CJHCCJGD

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/rules_start.htm#ASRUG541

We can define bucket set to allow a possible set of values to be used in our business rule,This will be very much clear with an example.

I will be using the same process as i have used in my previous exercise and will just make some small changes in it to see how bucketsets work in soa suite 11g

Click on bucket set and create a list of values as shown below





now we will create a set of values as shown below.



Now we will go to the ruleset we have created and now we will select the bucketsets as shown and then we will choose the value from the bucketset as shown we have the list of values appearing as shown below.



As you can see we can select two values in a rule as we have selected nitin and surya in one rule R2

So now we will see with different input values

For input -nitin and surya the output is house no 401

For input -sandy ,since there is no rule defined for this input we will receive an error


Hide Additional Trace Information
java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: null at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:575) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:381) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:298) at sun.reflect.GeneratedMethodAccessor1277.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(AstValue.java:157) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283) at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53) at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1245) at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:90) at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._process

For any other input i will get the output as "cat"

Since in my case i was using string value as input you can use integer element and choose the range of values in bucketset.

As can be seen here there are two range of values

one is less than 2 and other is greater than or equal to 2.

No comments: