Monday, 20 July 2015

equals() method in Comparator Interface in java

Why there is equals() in Comparator Interface when it is already defined in Object class which is super class of all classes in Java??

The only reason that the equals() is defined again in the Comparator Interface is just to defined some different documentation of equals() in Comparator interface. The equals() method in Comparator interface has some extra documentation which is specific to Comparator functionality.

Have a look at the documentation of equals() method in Compartor interface here.


Thursday, 7 May 2015

Handling CDATA in BPM Web Service call

The most common problem that we face while invoking a web service which expects some xml as a string in CDATA from oracle BPM/BPEL.
Like 

"<![CDATA[<UnderwriterAssignment><ApplicationID>XXXXXXXX</ApplicationID><Underwriter>XXXX</Underwriter></UnderwriterAssignment>]]>"

The above string has to be passed to the webservice as a string.

The problem here is the engine will convert the < and > to &lt; and &gt; while invoking. But the service may not be coded in such a ways that it accepts like that and the web service invokation will fail.

To resolve this, 

  • Prepared (assign) the string that needs to be sent as CDATA.
  • someString = "<UnderwriterAssignment><ApplicationID>ATL620007</ApplicationID><Underwriter>satishs</Underwriter></UnderwriterAssignment>"
  • On the service call use ora:toCDATA() to convert it into proper CDATA without encoding
  • like ora:toCDATA(someString).
This will not encode the string and it will pass as it is.

Tuesday, 14 April 2015

Issue while deploying case data form in oracle ACM

I am working on a case management POC in BPM version 11.1.1.7.

I had generated the case data form UI project and trying to deploy the project. But the data form in case is not coming up. The case data UI project is not part of the ear/war that is getting generated.

So I had included the case data UI project manually into the ear deployment profile. But while deploying the ear I am getting the below error,

ClassNotFoundError :oracle.bpm.casemgmt.client.forms.servlet.CaseFormServlet

To resolve this issue, I have to manually add the below jars case UI project 

oracle.bpm.casemgmt.implementation.jar
oracle.bpm.casemgmt.interface.jar

You can find these jars under jdevhome\jdeveloper\soa\modules\oracle.bpm.runtime_11.1.1


Deploy the generated ear project and it works.

Wednesday, 1 April 2015

Reusable process in Oracle BPM

In this post I just want to jot down my findings about the reusable processes in oracle BPM.

  • Reusable Process starts with a None start event.
  • And there won't be initiator after that.
  • If any initiator node is added, or the start event is changed, this no longer becomes a reusable process.
  • A Reusable Process can be called from a 'Call' Activity
  • Most importantly the execution data will be carry forwarded from the calling process to the reusable process.
    • Means the attachments, user comments that are added in the calling process will be available in the reusable process.




In the above sample processes, the first process will the second reusable process using the call activity.
Whatever the documents uploaded or comments entered in the first human task in the first process will be available for the first human task in the second process. So it is like only one process is getting executed with respect to the execution data.

Monday, 30 March 2015

Using for loop in XSL

By default xsl supports the for-each functionality which will iterate over the number of elements in source xml.
But what if we need something like for loop in normal programming language??
like for (int i=0;i<10 ;i++)

Solution:
We can achieve the above requirement with the help of callable template as described below,


 <xsl:template name="party">
    <xsl:param name="count"/>
    <xsl:param name="xml"/>

    <xsl:if test=" $count > 0">
            <name>
                  <xsl:value-of select="$xml/name"/>
          </name>
     </xsl:if>     
      <xsl:call-template name="party">
            <xsl:with-param name="count" select="$count - 1"/>
            <xsl:with-param name="xml" select="/"/>
        </xsl:call-template>  
  </xsl:template>          
       
   
Call the above template like this,

        <xsl:call-template name="party">
            <xsl:with-param name="count" select="6"/>
            <xsl:with-param name="xml" select="/"/>
        </xsl:call-template>           
                   
 
Above code creates the tag six times.

In this you can see how to access the source xml in the templates.
As you will not have direct access to the source xml in the callable template we need to pass it as parameter and use in the template.

Thursday, 27 November 2014

Service Bus 12c deployment issue: MalformedURLException

This is the first error that i had encountered when i started working with oracle service bus 12c.











The resolution is,


  • Open weblogic admin console and go to Services --> OSGi Frameworks
  • Select bac-svnserver-osgi-framework








  • Enter felix.service.urlhandlers=false in the init properties.


















  • Save the changes and restart the server. The above error should be resolved.



Wednesday, 19 November 2014

Correlation in oracle BPM 12c (with initiator task)

Using correlation with initiator task in oracle BPM 12c (or in 11g). i. e.., if your requirement is something like you have an initiator task where the process will be kick started and at some point in the process you are using a catch message event waiting for an external system to invoke this and resume the process with the help of correlation.

And surprisingly the correlation didn't work for me.

So I had used and alternative which solved my problem. I moved the catch message event to another process with message start event and called that process from this main process. 

PS: Its a temporary work around that I followed(and worked for my scenario) which might have other issues like timeout for service call etc.