Monday, June 28, 2010

SOA Transactions - A very good reference and read

I was reading some random blog posts on OWSM 11g when, in one of the posts, I found this link to Oracle blogs. The blog has two parts and has covered the SOA transactions very nicely. The blog has been explicated in a simple, easy to understand manner. The transactions has been explained keeping in mind SOA11g. I guess there would not be a huge difference when this is applied to 10g. The links are below:

Part One and Part Two


Peace !

Cheers,
-AR

Wednesday, June 23, 2010

Fields with type int and decimal when sent in the input to Rules do not out come as in input

I created a BPEL Process which receives a XML payload which has fields of type int as well as decimal, as defined in the XSD that the payload is derived from. These fields, part of the payload, are sent in the input to Rules Dictionary using decision service activity from BPEL. In the input to rules, the XML has a couple of fields of type "int" and couple of fields of type "decimal" and the three of them are sent as empty/null. In the output from the rules however, the fields of type "int" have value of zero and fields of type "decimal" do not come out at all, even though they were empty/null and present in the input.

In the below sample, <client:DuplicateMobile/> , <client:DuplicateLan/> and  <client:DuplicateBill/> are sent as null. DuplicateMobile and DuplicateLan are of type "int" and DuplicateBill is of type "decimal". No actions are performed on these fields/facts within the rules. The input and output looks like below:


################################### Input ########################
Facts_To_BPEL_Var

<dsIn>
<part name="payload">
<callFunctionStateless name="Sample1_DecisionService_1">
<parameterList>
<Person>
<client:Name>
<client:firstName>A</client:firstName>
<client:lastName>A</client:lastName>
</client:Name>
<client:address>
<client:lineOne>1</client:lineOne>
<client:lineTwo>2</client:lineTwo>
<client:city>3</client:city>
</client:address>
<client:Phone>
<client:Mobile>4455</client:Mobile>
<client:Lan>4466</client:Lan>
<client:DuplicateMobile/>
<client:DuplicateLan/>
<client:DuplicateBill/>
<client:Bill>500</client:Bill>
</client:Phone>
<client:Status>Open</client:Status>
</Person>
</parameterList>
</callFunctionStateless>
</part>
</dsIn>
################################### End Input ########################

################################### Output ########################
replyOutput

<RulesInput>
<Person>
<Name>
<firstName>A</firstName>
<lastName>A</lastName>
</Name>
<address>
<lineOne>1</lineOne>
<lineTwo>2</lineTwo>
<city>3</city>
</address>
<Phone>
<Mobile>4455</Mobile>
<Lan>4466</Lan>
<Bill>500</Bill>
<DuplicateMobile>0</DuplicateMobile>
<DuplicateLan>0</DuplicateLan>
</Phone>
<Status>Approved</Status>
</Person>
</RulesInput>
################################### End Output ########################


I have raised a Service Request with Oracle and they have confirmed it to be a be a bug (Bug 9794889: BLANK DECIMAL FIELD INPUT TO RULES ENGINE GETS REMOVED). I do not have the resolution yet and I will update as and when I have one. If somebody is facing the same issue, workaround the issue by modifying the output from rules using a XSLT, before it is processes further !

Peace !

Cheers,
-AR

Tuesday, June 22, 2010

Fusion Middleware on Oracletube

I knew that Oracle blogs and Oracle wiki existed. I happened to looking into one of the posts in Oracle blogs and I was surprised to know about the existence of Oracletube. Oracletube, I presume, serves the purpose of a youtube for Oracle products/updates/support. It hosts a number of screencasts which are actually useful and good.

Here is the link to Oracletube and Fusion Middleware section in Oracletube


Peace !

Cheers,
-AR

Monday, June 21, 2010

Expose Dictionaries as Composite Service

I had the discussed cases where decision services were exposed as web services, that could be consumed by BPEL or a Java Client. The dictionary itself, can be exposed as a Composite Service by checking the option as shown below, meaning, you do not need a BPEL to invoke the rules and the consumer can directly pass the payload to the decision service/dictionary and get the output.















I worked on such a case, and I had some issues in hitting the Composite Service. Once the project has been developed and deployed, you can use any web service testing tool to test it. I used SoapUI in this case. I imported the WSDL, created a request and hit the web service using the option of "callFunctionStateless" (the SoapUI created two methods - callFunctionStateless and callFunctionStateful). I got an error as below:


<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <env:Fault xmlns:fpre="http://xmlns.oracle.com/bpel/rules">
         <faultcode>fpre:operationErroredFault</faultcode>
         <faultstring/>
         <faultactor/>
         <detail>
            <errorInfo xmlns="http://xmlns.oracle.com/bpel/rules">
               <errorMessage>RulesWithoutBPEL</errorMessage>
            </errorInfo>
         </detail>
      </env:Fault>
   </env:Body>
</env:Envelope>

I then realized that under the soap:Body, there is a method by name <orac:callFunctionStateless name="">. In the attribute, the name of the decision service which has been exposed as web service should be given. It worked after that !


Peace!

Cheers,
-AR

Friday, June 18, 2010

Special Characters like !,@,#,& in Bucket Sets not supported

Its been quite sometime that I had been working on Oracle Business Rules. I noticed that when configuring aliases in the project with the use of bucket sets, few of the characters were not supported in the bucket set. When these characters were used in bucket sets, and when choosing the alias in decision table actions, the alias was not available, but the value of that alias was only available. I have shown the issue below.

However, this should does not stop one from using these characters. The alias may not be available in the decision table actions, but the decision table works alright. Also, this issue is not spotted when we use the bucket set in conditions and we can choose the alias in conditions. So you can go ahead and use it, compromising on the fact that, the alias would not be available in the decision table.

Bucket Set defined:
 









Bucket Set used in Decision Table Actions:











Bucket Set used in Decision Table Conditions:











Note: I had raised an Oracle SR and what is stated above was confirmed in the SR. Have pasted the SR update below:

In a decision table you can use either bucket alias or bucket name . If your alias contains special chars then you must use the bucket name . OR Set the bucket alias to contain only letters and number and there will be no problems at all . This is not yet in any doc - is just the update to the bug that will be merged to official documentation.


Peace !

Cheers,
-AR

Thursday, June 17, 2010

Extract Composite Audit Trail from database table as XML

After I had done some reading on the database tables that were used for storing the instance details, I did find some information from Oracle forums to use the composite instance id to extract the audit xml from the database tables. A function had to created in the database under the same user (preferably) i.e. SOAINFRA. In case of 10g, to view the BPEL audit xml, create the function in ORABPEL. The function will take composite instance as input and return the audit as BLOB, through a query.

Function be created:

CREATE OR REPLACE FUNCTION get_audit_trail_log(cikey IN INTEGER) RETURN blob IS
--
CURSOR c_log(l_cikey INTEGER) IS
SELECT *
FROM audit_trail atr
WHERE cikey = l_cikey
ORDER BY count_id;
--
bl BLOB;
BEGIN
dbms_lob.createtemporary (bl, TRUE);
FOR r_log IN c_log(cikey)
LOOP
dbms_lob.append (bl,r_log.log);
END LOOP;
--
RETURN(bl);
END;


Query to fetch the details of an instance (instance id = 51560794):

SELECT UTL_COMPRESS.LZ_UNCOMPRESS(get_audit_trail_log(ci.cikey))
FROM cube_instance ci
WHERE ci.cikey = 51560794


To read more on this, visit the Oracle Forums where this thread is available.


Peace!

Cheers,
-AR

Wednesday, June 16, 2010

Database tables used to store the instance details

I was working on a task this week, where I had to extract the RAW xml in the audit tab of an instance. Since all the details that are rendered on the BPEL console are from the database, I started to explore some details on the tables used in SOA. The tables are more or less common to 10g as well as 11g, which very little variations. I was going though some of the tables present in the database and below is the information I gathered.  I have shown below some non empty and key fields from the table. There are more fields available in the table and can be viewed from the database:

CUBE_INSTANCE
This table stores the basic information of an instance such as State, Domain name, Composite name, composite revision, Component name etc. A CI Key is created for every Composite Id and the CI key is used in other tables as the reference




CUBE_SCOPE
It stores the data available in the scope of an instance like the bpel variables that have been created, values of those variables etc.




AUDIT_TRAIL
This stores the complete the audit trail of an instance, provided the auditDetailThreshold is not reached. If the auditDetailThreshold is reached, the details are spilled to audit_details table. The instance details are stored in the RAW format and you would have to join the columns together and uncompress the RAW format to view in the readable xml format. The column LOG contains the RAW message




AUDIT_DETAILS
The details like the assign activities are stored here. The information that goes into the audit tables are determined from the auditLevel property set in the domain or for a composite


The difference between 10g and 11g is that, as far 11g is concerned, the EM is one stop for viewing all instances. So instances are stored in the tables mentioned above in the schema SOAINFRA. The Mediator instances can be viewed in the MEDIATOR_INSTANCE, MEDIATOR_* in the same schema. On the other hand, 10g had separate tables for tracking BPEL and ESB instances. The tables mentioned above are used for storing bpel instance details and can be found under the schema ORABPEL. The ESB instance deatils are stored in the tables mentioned below and can be found under ORAESB schema:

ESB_ACTIVITY, ESB_TRACKING_FIELD_VALUE, ESB_FAULTED_INSTANCE, ESB_TRANSACTION_STATUS

There are some interesting links that provide details on these tables. Some of them are below:

Tables used in BPEL instance tracking
Oracle Cookbook for SOA 10g
Table used in SOA 10g ESB instance tracking

Peace!

Cheers,
-AR

Decision Table changes become slow with Tree Mode on

I had a post on Tree Mode in OBR recently. I also did notice that the Jdeveloper became slow, sometimes unresponsive to changes being done in the dictionary when the option of Tree Mode was selected in the decision functions, that existed in the dictionary. I was able to work around that problem and I am now doing the below, when working with decision functions that use tree mode:
  1. In the decision function of the decision table, uncheck the option tree mode temporarily
  2. Make the changes in the decision table. The speed with which the changes reflect now will be the same as what it was initially
  3. Make Sure, once the changes are done, the tree mode option is checked in the decision function
Even if you forget to check the option again in the decision table, no worries. Rule engine will not validate the dictionary and would not let the project to be deployed. The reason why the changes become slow when the tree mode is selected is not yet known officially, but my guess is that, the rule engine tries to validate the payload for changes in the tree mode, which means it has to iterate through all the elements. In the other case, the payload and definition must have been cached.

Peace!

Cheers,
-AR

Monday, June 14, 2010

View stale Instances in SOA 10g/11g

If you had re-deployed a BPEL Process in 10g, the instances that were available before the re-deployment, would have become stale (grayed out) and you would not be able to see the Flow/Audit Trail. There will be an error stating "revision for the instance # was not loaded by the domain...XXProcess revision 1.0 may have been deleted from the domain manually; in this case the domain would not have been able to mark all instances belonging to the process as stale". You can however, view the instance by clicking on "View Raw XML" from the audit table, in the XML form.

In 11g, this problem seems to have been overcome. The instances of the composite can be viewed from the Audit Trail/Flow tab even though the instance has been marked "Stale", like seeing any active instance of a composite.

Peace!

Cheers,
-AR

Friday, June 11, 2010

Unable to copy rules within decision table – Table locked error

Decision table is an easy to understand and the best means to depict your conditions when you are validating against many facts and asserting more than fact, as a result. But, if there too many rules that you need to configure, it becomes a mundane task to create rules in a decision table. The simplest way we all know to replicate something is a copy-paste and rules is no different. The decision table has an option "copy" when you right click on a rule. But when try to copy and paste a rule, you get an error:









I had raised a SR with Oracle and I was informed that this option would be removed from Rules UI, in the future releases of OBR.

I found another easier option to replicate rules. For instance, if you have configured a rule asserting/modifying many facts in the actions based on a boolean condition and you would want to replicate the actions for other condition of boolean expression, try selecting both true/false in conditions and then split the cell (right click on condition to find the option "Split Selected Cell"). This will create two rules identical to each other, one for boolean expression true and other, false !

Peace!

Cheers,
-AR

Thursday, June 10, 2010

Tree Mode in Oracle Business Rules 11g

I was struggling sometime last week with an issue in using the "Tree Mode" option in the decision table of a dictionary in Oracle Business Rules 11g (OBR). I selected the tree mode option in the decision table and selected the root for the tree mode also. I configured my decision table as required and that did not have any errors. However, there was some error in dictionary validation like:

RUL-05162: The rule set "ACU" requires fact type "ServiceType", but this type is not part of the input.
TEST/Data Model/Decision Function(TEST_DecisionService_1)
RUL-05162: The rule set "UCS" requires fact type "ServiceType", but this type is not part of the input.
TEST/Data Model/Decision Function(TEST_DecisionService_1)
RUL-05162: The rule set "AMB" requires fact type "ServiceType", but this type is not part of the input.
TEST/Data Model/Decision Function(TEST_DecisionService_1)
RUL-05162: The rule set "ALG" requires fact type "ServiceType", but this type is not part of the input.
TEST/Data Model/Decision Function(TEST_DecisionService_1)
RUL-05164: The fact type "ServiceType" is referenced, but is not asserted nor input.
TEST/Data Model/Decision Function(TEST_DecisionService_1)


Then I found that the tree mode option had to be selected in the decision function also. If a dictionary makes a call to another dictionary which uses the tree mode option, the dictionary that is making the call should also have the tree mode option chosen !

The selection of tree mode option in the decision table is available in OBR Users Guide (section 4.8). However, check the option in the decision function as below:












Peace !

Cheers,
-AR

Wednesday, June 9, 2010

Error during composite deployment due to lack of space

I have faced this error in 10g and I faced it in 11g yesterday. The composite was not getting deployed and it was throwing the below error. It took sometime for me to re-collect that I had already faced this in 10g. Eventually I did and checked the space in the machine hosting the domain and free space was 0%. I cleared some space and bounced the server. The deployment went just fine..

[06:27:08 PM] Error deploying archive sca_JMSConsumerService_rev2.0.jar to soa_server1 [10.132.214.255:7504] 
[06:27:08 PM] HTTP error code returned [500]
[06:27:08 PM] Error message from server:
Error during deployment: Error occurred during deployment of component: JMS_Consumer to service engine: implementation.bpel, for composite: JMSConsumerService: ORABPEL-05250
Error deploying BPEL suitcase.
error while attempting to deploy the BPEL component file "/opt/apps/wls01/user_projects/domains/soa_domain/deployed-composites/JMSConsumerService_rev2.0/sca_JMSConsumerService_rev2.0/3e5eea29-29c3-426d-94e9-e4263b0d30bd"; the exception reported is: java.lang.RuntimeException: Couldn't make directory /opt/apps/wls01/user_projects/domains/soa_domain/deployed-composites/JMSConsumerService_rev2.0/sca_JMSConsumerService_rev2.0/3e5eea29-29c3-426d-94e9-e4263b0d30bd/SCA-INF/bpel/JMS_Consumer
This error contained an exception thrown by the underlying deployment module.
Verify the exception trace in the log (with logging level set to debug mode).
[06:27:08 PM] Check server log for more details.
[06:27:08 PM] Error deploying archive sca_JMSConsumerService_rev2.0.jar to soa_server1 [10.132.214.255:7504] 
[06:27:08 PM] ####  Deployment incomplete.  ####
[06:27:08 PM] Error deploying archive file:/C:/JDeveloper/mywork/AIAPOC/JMSConsumer/deploy/sca_JMSConsumerService_rev2.0.jar
 (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)


Check for space in the machine when you face a BPEL suitcase error.

Peace !

Cheers,
-AR

Tuesday, June 8, 2010

Composite Audit Settings

I was trying to tweak the audit settings in SOA 11g from the Enterprise Manager console. I realized that when I chose not to create audit for composite, even the instance of the composite was not created. Choose the audit level to Production when you want the instances to be created with minimal payload artifacts.

Go to the composite > Settings > Composite Audit Level : Inherit > Off.


Detailed read on settings available here. Refer to table by name "Table 1-1 Examples of Order of Precedence" under section 1.4.1.1.

 I had a BPEL flow which was using the function ora:getCompositeInstanceId() to read the composite  instance id. When I set the logging off, the assign node in BPEL gave me an null pointer error. The instance id had not been generated. Also, the ora:getCompositeInstanceId() has to be used in an Assign node. I tried using it in a xslt, but the instance id did not get mapped to the output. So I think we would have no option but to use this function in an assign node.

Even in 10g, the function ora:getInstanceId() did not work in xslt. It worked when used as part of Assign node only.

Peace !

Cheers,
-AR
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License