Wednesday, December 29, 2010

FOTY0001: Type Error

I have encountered the below error during runtime many a time:

ORABPEL-09500
XPath expression failed to execute.
Error while processing xpath expression, the expression is "ora:processXSLT('Transformation_5.xsl',bpws:getVariableData('inputVariable','payload'))", the reason is FOTY0001: type error. Please verify the xpath query.

This error, though mentions the reason for failure was due to a xpath expression, when one executes the xslt using xalan or test option of Jdeveloper, the xslt works fine. I later found that the part name was missing in the transformation node where the xsl was used. This could be because, the bpel file was edited prematurely even before the details of the node were loaded or could be an actual issue with the schema (in case of first timers)!

Always check if the part name in the transformation node are present and are correct before debugging further on this error. I found the this link useful when I was debugging.

Please note this is only one such FOTY0001 error (most common) and one such solution which worked for me. There could be many other reasons for the error in different scenarios and hence different resolutions.

Cheers,
-AR

Saturday, December 18, 2010

Oracle Business Rules as a Composite Service

The general practice of using Oracle Business Rules is to create a set of rules in a dictionary and this dictionary in turn will be invoke by a bpel, which would have been exposed as a web service or composite service. But there are cases where a bpel is not needed and one needs the service of just rules.

In those particular cases, the dictionary themselves can be exposed as a composite service. So a web service would be created which would directly interface with the dictionary. A couple of points has to be noted when doing this and apart from that, its just a normal rules configuration, soa composite deploy and test:

Create an empty composite, just add a dictionary and make sure to mark the dictionary for the below:





































When testing the service, it would require the name of the decision function to be passed. Earlier this was taken care by the bpel when we used to drag drop the business rules component and choose the dictionary and decision function:











Cheers,
-AR

Sunday, November 28, 2010

Upcoming Review of the book - Getting Started with Oracle BPM Suite 11gR1

I have been reading technical articles and books on SOA and related technologies. I have read several books to learn about Fusion Middleware 11g and one of the most effective ones among the lot was "Getting Started With Oracle SOA Suite 11g R1". The book was very practical and the gets you started very fast with hands-on on Oracle SOA Suite 11g.

Now, when I want to teach myself Oracle BPM 11g, I am naturally attracted to a book, similar in nature, for BPM, "Getting Started with Oracle BPM Suite 11gR1". I will be using the book for learning BPM, on a hands-on level. On completion of this book, I would put forth my review of the book. In the meantime, for those interested to help me out on this exercise, the book can be found and bought via the link below (Click on the picture to find and purchase the book).













Cheers,
- AR

Sunday, October 10, 2010

ora:parseEscapedXml function fails during conversion

The ora:parseEscapedXml functions fails to convert string which have & 'Ampersand' in them. It errors during conversion and the error in the BPEL Console is nowhere close to the issue. There has already a bug filed for this issue, bug# 5598150 and it appears to have been fixed in 11.1.1.0.0. I am running on 11.1.1.2.0 and I still face this issue !

On metalink, there is a workarouund provided for this issue. One needs to replace & with & amp; amp; (mentioned with spaces so that its not converted to & by html). This can be done using a XSLT replace all template or a java embedding node.

Refer to How to solve the Ora:Parseescapedxml error when you are using ampersand character [ID 418488.1] in metalink for the workaround using java.


Bug 5598150 - AMPERSAND ENTITY IS NOT HANDLED CORRECT




Peace!


Cheers,
-AR

Thursday, September 30, 2010

Re-generation of facts fail when Java facts originating from same Schema exits

Re-generation of facts in a dictionary in Oracle Business Rules 11g is a simple step. One needs to just update the schema and reload the facts from the options available in the Fact tab of the dictionary. Unfortunately, I had been struggling for more than two weeks on this simple step and any change in schema, be it addition/deletion of an element or change in an element's type, the facts in the dictionary were so glued to the dictionary that, they refused to update !

I pondered over a lot of options and tried a lot of workarounds/suggestions:

  • Re-created the schema and imported the schema again into Jdeveloper
  • Cleaned the temporary files in windows which Jdeveloper creates, stores and uses, available under an user's profile
  • Reloaded the facts in the dictionary in a different package (not the default). This updated the facts but all the existing reference in the dictionary had errors in them
  • I even re-designed the schema based on one of my earlier posts
 All my efforts were futile and we had in the meanwhile a SR open with Oracle and we were getting some directions from them. Finally, Oracle found that we had been using a java fact created from the same schema  and imported via a jar, which was the issue!

Since the jaxb objects were the same, they was issue in refreshing the xml facts when a java fact belonging to same schema existed in the same dictionary. Below are the steps to be followed when a xml fact has to be refreshed (as in the case mentioned above):

  1. Exit Jdeveloper
  2. Remove the jar referenced to import the java fact (from hard disk)
  3. Start Jdeveloper, remove the jar from project reference
  4. Update the schema (preferably, open the schema and update contents instead of a replace of .xsd file)
  5. Save all artifacts and run a clean up (not necessary, just a feel good factor) from Build>CleanAll
  6. Reload facts from updated Schema and check for the same (in case not refreshed, close Jdeveloper and try cleaning workspace)
  7. Update the jar with the update schema and reference it in the project properties
Good to move on now !!

Peace!

Cheers,
-AR

Wednesday, September 22, 2010

Using Dynamic Endpoint for a non-AIA based Composite in SOA 11g

The use of dynamic endpoint approach for a non-AIA based Composite is more or less the same, as it would have to been done for an AIA Composite. The stress on AIA in the implementation of dynamic endpoint is because AIA has AIAConfigurations.properties file, where usually this type information is stored. This information can be changed, loaded and reference at runtime, and so making the endpoint dynamic. The non-existence of AIA does not limit one from implementing this.

One just needs to make sure, AIA is replaced by a suitable component. By this statement, I mean one needs to make sure a mechanism is available to change, load and reference the endpoint at runtime. Oracle Fusion Middleware offers a lot of option for one to replace AIA. You can do any one of the below and yet use the dynamic endpoint feature without AIA:
  • Store information in a file and use file adapter to read the file whenever required
  • Store information in a database table and use a DB adapter to fetch the information
  • Use BPEL Preference Properties to store the information (Preference Properties can be modified at runtime from EM Console)
  • Store the information in Domain Value Map (DVM) and use functions to read the information from DVM
In all the cases, the information can be modified on the fly and each have their own set of limitations. I  saw DVM as the simplest, straightforward, hassle-free and readymade approach towards dynamic endpoint.

I created a DVM to store the information: Name of the Composite and Endpoint URI for the Composite. Teh DVM can be created within the Composite or deployed to MDS directly and referred from MDS. As to, how to deploy the DVM to MDS and referring from MDS, read this post.

Implementing the Dynamic Endpoint:

Creating Variables in BPEL:

  1. Create two variables in the BPEL flow namely, TargetEndpointLocation (String) and EndpointReference (of Type EndpointReference from WS-Addressing)
  2. When creating  the variable EndpointReference, import the XSD ws_addressing.xsd and choose the element type EndpointReference to create the variable
  3. ws_addressing.xsd can be downloaded from here
  4. This way, one need not copy-paste any code, or insert any namespace in the BPEL Process and its corresponding WSDL 
  5. After creating the variables, open the .bpel in source  mode and look for the namespace http://schemas.xmlsoap.org/ws/2003/03/addressing. Change the namespace prefix to wsa so that the namespace looks like below:
     xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
Implementing the dynamic endpoint:

  1. Use the dvm:lookupValue function to look up the endpoint URI from the DVM. In the code snippet below, I have the DVM in MDS and I am looking up a DVM by name Endpoints to get the endpoint URI
  2. Assign the URI to /wsa:EndpointReference/wsa:Address
  3. Assign the /wsa:EndpointReference/wsa:Address to Partner link in the invoke that follows this logic
  4. Insert the below code snippet just before the invoke node from the source view of the .bpel

Code Snippet:

<scope name="Scope_GetDynamicEndpoint">
    <sequence>
        <assign name="Assign_targetEndpointLocation">
            <copy>
                <from expression="dvm:lookupValue('oramds:/apps/Samples/Endpoints.dvm','ServiceName','SampleFlow','EndPoint','')"/>
                <to variable="TargetEndpointLocation"/>
            </copy>
        </assign>
        <assign name="AssignPartnerlinkEndpointReference">
            <copy>
                <from>
                    <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
                        <wsa:Address/>
                    </wsa:EndpointReference>
                </from>
                <to variable="EndpointReference" query="/wsa:EndpointReference"/>
            </copy>
            <copy>
                <from variable="TargetEndpointLocation"/>
                <to variable="EndpointReference"
                query="/wsa:EndpointReference/wsa:Address"/>
            </copy>
            <copy>
                <from variable="EndpointReference"/>
                <to partnerLink="SampleFlowTarget"/>
            </copy>
        </assign>
    </sequence>
</scope>

    inputVariable="Invoke_SampleFlowTarget_InputVariable"
    ......



Peace!

Cheers,
- AR

Monday, September 13, 2010

Function to find age in years in Oracle Business Rules

I was part of a discussion recently - can age be found within business rules or can bpel do the math and get it for business rules. Business rules is not less incompetent and it does offer capability to mathematical calculations or so called numerical manipulations.

I had a date captured in a tag of type String and sent to business rules. I had to find the age from the date received in input. I have written a function in business rules that can get this done. Essentially the date is converted from string to date and then a difference in dates, will get you the result as an integer.

Duration.years between(OracleDate.from string(arg_1.IP1),RL.date.get current())










Peace!

Cheers,
-AR

Sunday, September 5, 2010

Schema design - when Schema is to be used for dictionary

Quite recently, I was struggling with an issue that Tree Mode in Oracle Business Rules was not working. This was not definitely the first time I was working with Tree Mode and I had used it before successfully. In the project where I noticed the issue, the tree mode expression assigned by JDeveloper was weird. Usually its the dots and slashes that you notice in a tree mode, but here, it was dollars.

For instance, consider an order having many order lines. When you refer to orderlinenumber within the order line, the tree mode in my project with issues looked like $Order$OrderLine$OrderLineNumber. In an usual case, it would have been Order/OrderLine.OrderLineNumber.

I then compared the project which worked fine with my current project. The issue was with the facts generated and hence the XSDs created in both the projects. The first project had a complex type defined for every element and that element had in its type the complex type definition. However, in the current project, there was no complex type defined and elements were defined individually and referenced within each other. This is still valid as per W3C standards. The XSD in both cases were as below:











The change in XSD also changed the way the facts were created. The facts in the first case were created based on the elements where as in the second case, it was the Complex types that was used by the Jaxb to create the facts !

Peace !

Cheers,
-AR

Tuesday, August 24, 2010

Compare between facts in condition

In Oracle Business Rules, it is usually the practice to validate a fact against a constant. But there might be cases where you would want to map the input from an user to one of fact, compare another fact with input from the user and make decisions. In other words, when the value of the constant to be issued in the condition is itself ambiguous, it is better to use the facts vs facts instead of facts vs constant method. For instance, I have a case where I have three inputs IP1, IP2 and IP3 coming in and I do not want to fix values (use constants for comparison in condition of rules) and instead make a condition directly involving IP1, IP2 and IP3. My schema in such a case will look like:

The decision table involving the facts will look like below:











The facts have been directly compared against each other without the need for a constant.

Peace!

Cheers,
- AR

Tuesday, August 10, 2010

The rete network does not update the modified data

This is a case where there is a dictionary D1 which is being invoked from BPEL. A set of facts F1, is passed to D1 and the same is returned from D1. There also exists D2, which uses the same set of facts as D1. D2 is invoked from the decision function of D1 (after D2 has been linked to D1, obviously !). I get F1 into D1 and I make a call to D2. D2 modifies F1 to F1.1 and returns call to D1. However, D1 does not understand F1 has changed to F1.1 and since it has been initialized with F1, continues to process the rules with F1 and F1.1 is not all considered.

This has been confirmed to be an inconsistent behavior from the rete network and rules engine and it has been identified as a bug. It would be fixed in the future releases (not sure of the release). Till if you face the same issue, you can survive with two workarounds:

A: Make call outs to rules from BPEL
  1. Call D1 from BPEL, execute rules in D1
  2. Instead of calling D2 from D1, call D2 from BPEL
  3. Then call D1 again. The rete network in this case initializes D1 with facts available in Step2
B: Assert the facts in D2 before returning control to D1
  1. Call D1, then D2 from decision function of D1
  2. Modify F1 to F1.1 in D2
  3. Using advanced functions do a assert and return of F1.1 (this makes the rete refresh the facts)
  4. Return control to D1 and proceed

Keep tracking this thread for the update on the bug and fix for the same !

Peace!

Cheers,
- AR

Monday, August 9, 2010

Reducing the size of dictionaries

I was working on a case study where I had to create close to 10 dictionaries, each of them having the same facts being passed to them. The XSD I was using was of a considerable size, say 27KB and the XML generated from it was 15KB. When the facts were created the dictionary size came to 1.3 MB. So since each of these dictionaries had facts imported in them, each was about 1.3 MB and so the entire .jar file post compiling was about 15 MB.

This was a simple 10 dictionaries in a project case. Consider 50-60 dictionaries and each of size 1 MB. The project would take about 20 minutes to deploy, considering my case study took 6 minutes to deploy. Maintenance becomes an issue here and SOA server after deployment becomes slow and unstable.

Alternative is, have the facts in one dictionary. Link this dictionary to all other dictionaries using the same facts and use the imported facts in rules. This reduces the size of the dictionaries considerably. Statistically, for my case study, the size of one of the dictionary (where facts were present) remained the same. The size of the others came down to 500KB (depends on decision table number, no.of rules etc) approx. The size of the entire deployable was halved.

Peace !

Cheers,
- AR

Thursday, July 22, 2010

Remove duplicates from an input XML using XSLT

It is often the case that an input XML may contain duplicate data. It might be necessary to filter the duplicate data using a unique identifier, also from the input and send only the non-repeating, unique data to the output. In these cases, this transformation can be used to filter the data in the input.
This can be better understood by mapping this case to a real time scenario. Let us assume an organization having employees who can work in more than one department. If the input is going to contain the list of employees based on the department, there will be some employees whose data can repeat, as they are part of more than one department. If we need to filter the result based on the employee id to get a set of non-repeating unique employees, this logic can be used.

The implementation of this logic has been done using the function “following::”. The transformation logic is as below:


<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
  <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
  <mapSources>
    <source type="XSD">
      <schema location="http://localhost:7778/Schemas/Sample.xsd"/>
      <rootElement name="SampleXML" namespace="http://xmlns.oracle.com/
SampleXML"/>
    </source>
  </mapSources>
  <mapTargets>
    <target type="XSD">
      <schema location="
http://localhost:7778/Schemas/Sample.xsd"/>
      <rootElement name="
SampleXML" namespace="http://xmlns.oracle.com/SampleXML"/>
    </target>
  </mapTargets>
  <!-- GENERATED BY ORACLE XSL MAPPER 10.1.3.4.0(build 080718.0645) AT [THU SEP 24 15:16:11 EEST 2009]. -->
?>
<xsl:stylesheet version="1.0"
                xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                exclude-result-prefixes="xsl xsd bpws hwf">
    <xsl:template match="/">
        <EmployeeListSorted>
            <xsl:for-each select="/EmployeeList/Employee[not(EmpId=following::EmpId)]">
                <xsl:sort select="./EmpId" order="ascending"/>
                <Employee>
                    <xsl:copy-of select="./Name"/>
                    <xsl:copy-of select="./EmpId"/>
                </Employee>
            </xsl:for-each>
        </EmployeeListSorted>
    </xsl:template>   
</xsl:stylesheet>



The preceding-sibling grouping technique did not work as because your nodes are not siblings of each other and because it only works where the grouping key is the string-value of the node, not where it is some other function of the node (here, its name).

Peace !

Cheers,
- AR

Monday, July 12, 2010

Deploying Oracle BRM JCA Adapter for Oracle AIA

This particular post would be useful for those working on Oracle SOA Suite 10g and having the stack Siebel, AIA and BRM. In the stack where there is Siebel, AIA and BRM, AIA invokes BRM through the JCA Adapter. This JCA Adapter is provided by the BRM Team. The JCA Adapter is responsible for converting the xml given by AIA to the input flist of BRM. The JCA Adapter also does a basic field level validation of the input xml with the opcode being called. This JCA Adapter is deployed in the middleware layer, using the Oracle SOA Suite’s EM Console.

Please do the following to deploy the JCA Adapter:

  1. Modify the application.xml: Go to $ORACLE_HOME/j2ee/$OC4J_CONTAINER/config and Modify the imported-shared-libraries to contain the oracle.bpel.common library also. Modify the imported-shared-libraries to contain the below entry:

    <import-shared-library name="oracle.bpel.common" />

    The imported-shared-libraries after the change will look as below:

    <imported-shared-libraries>
    <import-shared-library name="adf.oracle.domain" />
    <import-shared-library name="oracle.bpel.common" />
    </imported-shared-libraries>


  2. Deploy the JCA Adapter: Get the latest JCA Adapter from BRM, go to EM Console and navigate to oc4j_soa. Go to Applications tab, select Standalone Resource Adapters from the View drop down option and Choose Deploy, to deploy the BRM JCA Adapter. While deploying if the JCA Adapter is placed on the server directly, choose the option of location as Location on Server or if the JCA Adapter is present in the workstation, choose the option of browsing the file from the workstation. Choose Automatically create a new deployment plan option (Step 1/3), choose next, give a name for the Resource Adapter (Step 2/3) and make no changes in the Deployment Settings tab (Step 3/3). Click Return on successful deployment of the adapter.
  3. Create Connection Factory: Click on the JCA Adapter that was just deployed from Standalone Resource Adapters. Click on Connection Factories tab (need to create a Shared Connection Pool before we define the Connection Factory). So, click on Create option under Shared Connection Pools to create one. Create a connection factory using the shared connection pool that has been created. In JNDI Location, issue eis/BRM, choose Use Shared Connection Pool under Connection Pooling and change the Connection String to ip $BRMIPAddress $BRMPort, Username and Password of the BRM user that SOA Suite will use.
  4. Restart JCA Adapter: Stop the JCA Adapter by navigating to Standalone Resource Adapters and choosing the adapter.  Once stopped, start the JCA adapter from the same location.

Peace !

Cheers,
- AR

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

Friday, May 14, 2010

Interesting Finds

Interesting Finds - I will use this series of posts to share what I  found for the first time. I have a habit of keeping a record of what I learn new everyday and I try to keep a policy to learn something new everyday. It might not be something extraordinary, but even a simple finding as to how to deploy a code quicker by tweaking a parameter, is a new find as per me.

In case, you have some interesting finds that you want to be published here, do drop in a mail to arun.arunramesh@gmail.com and I shall update your find here, of course with your stamp on the find !!

Peace !

Cheers,
- AR

Saturday, April 24, 2010

Oracle Business Rules 11g - II

Well, as promised, here I am, back with some updates. Oracle Business Rules 11g (OBR) really is an interesting tool to work with. That does not mean I am going to take back my words that the scope of the OBR is limited. Its limited for those who plan to use the OBR more as a tool and for those who want to customize the product OBR, avenues are many and there is no stopping them from improvisations.

Its been a little over a couple of months on OBR now. I have a fairly clear idea on what the OBR should be used for and what it can deliver to you. There situations where OBR can be used are plenty, but there is always the choice that one has to make, whether you really need to use OBR. OBR really should be used where one is not sure about the conditions or touch points and how these touch points would change in the future. A simple case would be, in a telecom sphere, if you would have to choose the sets of commands to be fired at the network layer, you could use OBR to configure the parameters. If there are additional commands that need to be added or removed, it becomes easy in that case. And most importantly, the one who would be configuring plans and commands would be the product manager, who need not be technically proficient in Fusion Middleware and he would ideally be a person with more business knowledge and the use of OBR would make things simpler for him. There are humpteen scenarios which one can think at the wink of an eye.

But, there are scenarios where one cannot decide whether to use OBR or not. In those cases, more than analysing whether OBR is required or not, we would have to look at what the OBR would do. If OBR is used as a processing engine, my instinct tells me, its a strict NO to OBR. If the purpose is more of a simple decision making component with runtime flexibility, no doubt, OBR ! The only reason for NO to OBR in the case where OBR would be a processing engine, would be performance. OBR is bad in peformance when its loaded too much. When there are components like BPEL and Mediator available which are meant to be the processing engines and which deliver excellent performance, it does not justify the need to use OBR in those cases. With this post, I hope I have introduced OBR and would like to get to the technical part of OBR in the posts to come. All said and done, this has not stopped me from ruminating on what I have written above...

Peace !

Cheers,
- AR

Thursday, April 15, 2010

Oracle Business Rules 11g - I

It’s been only 45 days that I had started to work with Oracle Business Rules 11g. I had not worked extensively on Oracle Business Rules 10g, but I knew that it existed and I had done some simple samples. We could not really think of Business Rules handling complexities in 10g. 11g though has been improved and it has a few entities that make Rules 11g interesting to work with. To understand about the Oracle Business Rule 11g, I used the OBR 11h Users Guide available at the Official Site.

It was very interesting to work with Rules in the beginning but, I have to started to get a feeling that scope of OBR is limited and one cannot keep on working on OBR (you do not have much to work for that long). I intended this for people who use OBR as a tool and not for the ones involved in product development. To understand the basics and for access to samples, please visit the Official Site as there are enough materials to get started with.

I will come back with posts on issues, interesting things I found in OBR or if there is something I am still trying to figure out.

Peace !

Cheers,
- AR

Friday, February 26, 2010

AIA 30 - Time for a break !

Yupp, I will have to stop with AIA 30 for the time being. I am starting work on Oracle Business Rules 11g now.

So posts on OBR 11g will also be available on this blog !


Cheers,
- AR

Saturday, February 20, 2010

XREFs and DVMs in AIA30

In AIA 30, if you had to use XREFs or DVMs in your flows, you would have to have the extension functions in JDeveloper. In 10g, there was a patch from Oracle which added the aia.jar to the JDeveloper 10g library. In JDeveloper 11g, you would have to add an extension to JDeveloper, like we did for the SOA extension. This would patch the JDeveloper for the extension functions like lookup-dvm, populateXrefRow, lookupXrefRow and more.

Add the extension Service constructor to the JDeveloper. But this is not available globally yet and we will have to wait. Other option in case, you have managed to install AIA 30, is to in JDeveloper, navigate to Tools, Preferences, SOA and add the library aia.jar. The aia.jar is available under AIA_HOME/lib directory.


Cheers,
- AR

Friday, February 12, 2010

AIA Components in AIA 30

I installed Jdeveloper, begged and pleaded with my workstation and somehow completed some basic use cases. I tested the different messaging patterns and they worked as expected. But I did not use any of the AIA Infrastructure components during the testing. I had not used EBMs, DVMs or XREFs. So I thought I will do some cases using the components provided by AIA. I assumed we would have to refer to the AIA Components as we used to in 10g (http://ipaddress:port/AIAComponents). But alas, no ! That was not the case !

I went through some samples and found that they had referred AIA Components diferently. The url itself was very different. It was something like oramds:apps/../../../../../..EBM.xsd. Strange ! Then I had to go through the official blog of AIA and found out that I had to create a MDS connection to refer to the AIA Components. A MDS connection is a connection to the Meta data repository where these artifacts are stored. They are referred directly from the server. For creating a MDS connection, your Jdeveloper should have been patched with the SOA Extension. Using SOA Extension, you can create a SOA-MDS connection which in turn will use a database connection with the credentials of DEV_MDS. The SOA-MDS connection has to be created for the workspace and it should be DB based.

Once done, you can refer to the AIA Components using the SOA-MDS connection. This is one feature that is very different from 10g. In 10g its so very simple to refer to the AIA Components but it was pain when moving from one environment to another. We had to run a build to replace the URLs and refer to the AIA Components in that specific environment. In 11g however, when we create a SOA-MDS connection and refer to the artifacts, the URL in the bpel source is like “oramds:apps/AIA Components/Enteprise Object Library/..etc”. The keyword oramds is reserved and appserver understands it refers to the meta data repository. So you no more need the build when moving from one space to another. Enjoy !


Cheers,
- AR

Wednesday, February 10, 2010

Started on SOA 11g and AIA 30

I have atlast managed to do some hands on SOA 11g and AIA 3.0. But there are quite a few initial issues that I faced when I started off, with Jdeveloper. In 10g, it does not make a difference to work with Jdev 10.1.3.3 or 10.1.3.4 as the basics would function the same. By basics, I mean creating a project, connection or deploying. In 11g, I am still not sure if thats the issue, but three of us (me and a couple of my colleagues) faced the same issue and we were able to resolve it when we upgraded the Jdev. Btw the issue was that we were able to create a SOA-MDS connection (a SOA-MDS connection is used to refer to the AIA Components and it in turn uses a DB connection with the username DEV_MDS) but we were not able to see any schemas or wsdls. Again, as I had already mentioned, these connections could be made specific to workspace or application. It worked when we created the connection specific to application.

 
What we then did was to uninstall the JDEV 11.1.1.1.0 and upgrade to 11.1.1.2.0. We need an extension to this JDEV specifically for working with SOA projects (soa-jdev-extension). I again recommend to upgrade this to the corresponding JDEV version, soa-jdev-extension v11.1.1.2.0.12.16.

 
All set…but JDEV is killing my system. I run on 1GB RAM ! Happy Jdev’ing.

 Cheers,
- AR

Tuesday, February 9, 2010

SOA 11g and AIA 3.0

I had been involved in some beta testing of AIA 3.0 (lucky me ! ) with my new employer. AIA 3.0 is the first version of AIA on SOA 11g. I had worked on AIA 2.0.1 which was on SOA 10g prior to this. I should admit that I was lost when I started with 11g, starting from JDEV to the consoles that we use for testing the process deployed on the server. Looking at the amount of work gone in from Oracle to get this out, I wouldn’t be surprised if the older versions of AIA and SOA are phased out soon. I plan to test use cases for the different messaging patterns, use of cross references and DVMs and if possible, try to do some extensions to AOL (Application Object Library), EOL (Enterprise Object Library) and EBL (Enterprise Business Library). I would share my experience on 11g and AIA 3.0 as I progress with the plan chalked out. To start with, I would like to highlight the major differences that I found initially between SOA 10g / 11g and AIA 2.x / AIA 3.x. The differences as I had stated already, started right from the IDE used to how the application server components were structured. Some of them are:

  1. The JDEV that we used in 10g and 11g are different
  2. Oracle ESB replaced with Mediator
  3. The consoles available in 10g are no more available with 11g
  4. Application Server structure in 10g and 11g
  5. There is a huge difference in the number of AIA EBOs available in 3.x from 2.0, though not a huge change from 2.5 to 3.0, I guess
  6. The way we used to refer to the AIA artifacts (AOL, EOL and EBL) in 2.0 is very different and it’s not a direct reference from the Apache server as in 2.0
  7. There is this concept of Composites which was not available in 10g at all

Jdeveloper:

The JDEV used in 10g was just a winzip archive. It was enough to unzip this and start the JDEV using the jdeveloper.exe. In 11g, Oracle has provided a Jdeveloper Studio which is an installable. It comes with a Weblogic Server and ADF components. The Jdeveloper 11g is undoubtedly heavier than its predecessor. The connections you need to create here are slightly different. You can opt to create connections per application or one common to all applications. Creation of connections to Application Server, Database and other components are similar to what we do in 10g, exception being we connect to Weblogic server in 11g and we used to connect to OAS in 10g. If you have a system with 1GB RAM, be assured that your system is critical and is on ventilator. You require at least 2GB RAM if you would expect decent performance from your workstation. Anything greater than 2GB is a luxury and anything less, a curse!

Mediator instead of Oracle ESB:

The Oracle ESB has been replaced with the Mediator. Mediator is an enhanced version of Oracle ESB. Both have routing rules, transformation options and filter options. On top of that Mediator has the option of assign activity and routing more than one receiver and some more options. More on Mediator would be available in posts related to Mediator.

SOA Consoles:

There were different consoles available in 10g like the BPEL Console, ESB Console, EM Console and one page for AIA Components. In 11g, all these have been integrated in to a single Enterprise Manager Console. Of course, AIA will always a separate console of its own, be it 10g or 11g. The BPEL processes and the mediator together have been packed into a composite and it is this composite that it deployed on to the server. On clicking a composite, there are options available to test individual BPEL process and Mediators from the same console. The instances for the tests run will also be available from the same console, upon navigating to that particular composite. There is however one separate console available for Weblogic server from where we can manage the different managed servers like the soa server and monitor/manage the Weblogic Server as administrator.

Application Server Structure:

The basic structure found in 10g will no longer be available (obviously) as Weblogic Server structure is different from OAS. There will be a domain specific to soa server which will in turn contain the different artifacts. Again, more on this in the later posts.

EBOs available in AIA 3.0:

The number of EBOs available in AIA 3.0 has gone by quite a number compared to AIA 2.x versions. The 2.0.1, the version I have worked on extensively has about 12 EBOs max and versions like 2.5 had 68 EBOs. AIA 3.0 has 95 EBOs. The Industry specific EBOs have also gone up from AIA 2.5. The EBOs have become very specific and we can expect more in the coming versions of AIA. In fact, I would say things have become slightly easier for us. In 2.0.1, I had a difficult time in mapping the different entities to EBOs as the EBOs were very limited and details of the entity did not match with the EBO fields. As we have an EBO for almost all entities in an Industry, things should become trivial and clearer and the need to create custom fields would come down.

AIA Components:

The contents of the AIA Components and the way we have to reference the EBM available in AIA Components have completely changed in AIA 3.0. In AIA 2.x, the AIA Components had (only the major entities have been listed below):

  1. Application Object Library 
  2. EnterpriseBusinessServiceLibrary 
  3. EnterpriseObjectLibrary
The 3.0 in addition has ApplicationConnectorServiceLibrary, B2BObjectLibrary, B2BServiceLibrary, BusinessProcessServiceLibrary, InfrastructureServiceLibrary, DVMs, XREFs and the AIAConfigurationProperties.xml. All these components have been pushed into AIA Components and stored as Metadata in AIA. In 10g, we could access them using an URL. In 3.0 running on 11g, we need to create a connection to MDS repository and access these components. Extensions to these have not been explored and will be posted as and when I have done it.

Composites:

Composite is a new concept available in 11g. You can relate to a composite as a .jws in 10g. It’s a collection of BPEL processes and Mediators. In short, you need to create a composite first, add BPEL and Mediators to it and deploy the composite to the server. The testing and viewing of instances are specific to a composite from then on. On a different note, we can also say that a composite would be a one that represents a business case. Hence all BPEL processes and Mediators required for fulfilling that business case would comprise that composite. On the styles of Merriam Webster, “Composite - It’s a collection of related BPEL Processes and Mediators that may or may not invoke each other and each of the individual processes may or may not have an end point to test them individually (this depends entirely on the requirement)”. The definition might definitely violate the basic SOA rules and Composite is definitely a topic of debate and how they can be best fit in SOA.

——–
This is in short on what I could spot in 11g and AIA 3.0 without my spectacles. Posts with spectacles on would follow (no commitments on timeline !!, thats me !).



Cheers,
- AR

Friday, January 8, 2010

Bye to SOA 10g and AIA 2.x

Well.. the news is I have taken a shift in my job ! I will now be working with SOA 11g / AIA3.x to start, with my current employer.

So I guess it a break from 10g/AIA 2.x. But that would not stop my posts on 10g. They will come, but once in a while I guess !!


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