Sunday, June 05, 2011

Business Rules-Functions in SOA Suite 11g

As per ORacle documentation


http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/data_model.htm#ASRUG297

In Oracle Business Rules you define a function in a manner similar to a Java method, but an Oracle Business Rules function does not belong to a class. You can use Oracle Business Rules functions to extend a Java application object model so that users can perform operations in rules without modifying the original Java application code.

You can use an Oracle Business Rules function in a condition or in an action associated with a rule or a Decision Table.



You can also use an Oracle Business Rules function definition to share the same or a similar expression among several rules, and to return results to the application.

You can also follow some other links to get more information on functions in business rules

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/ext_func.htm#ASRUG1057

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/rtdt.htm#ASRUG532

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/rtdt.htm#ASRUG431

http://download.oracle.com/docs/cd/E17904_01/integration.1111/e10228/testing.htm#CEGDACHJ


In this exercise we will create a simple function in business rule and see how does it works.

I will just create a simple function and will check it from the jdeveloper itself.

Go to Business rules and click on Functions

Create a new Function and give it some random name.

here is what i have specified in my body

assign new String fname="Arpit"
assign new String lname="Rahi"
call print(message :fname+lname)
return true


There are few important things that we need to know that

1>For a test function, you cannot specify any arguments.That is there should be no argument in the argument list if you want to test it using the test function button of jdeveloper.

2>Dictionary should be valid.

3>For a test function, select boolean as return type

So following these three rules i have created my simple function which looks like this



Click on the test button and you will get the result of the function

No comments: