Friday, 16 June 2017

Unlocking oracle ICS flows

The new ICS release (17.2.5) has unlock feature,
​

To unlock the connection:
​
1. Log in again as the same user who was editing the connection when the browser crashed, then log out.
For example, if you were logged in as icsdeveloper when the browser crashed, log in again as icsdeveloper, and log out. This action unlocks the connection.
​

Monday, 20 March 2017

Error while deploying oracle BPM case management project

Version : Oracle BPM 12.2.1
You might face any of the following errors while deploying a BPM case management project.

- The process domain is encountering the following errors while loading the process "ProcessName" (composite "CompositeName"): Could not initialize variable.

- ":" is not allowed in the schema file (pointing to your base schema)

- Can't load case data for the process activity <Activity Name>


Resolution:

All the above errors are because of an error in auto generated schema file for case management rules (jdeveloper generates this file when you create a case). Go to Schemas folder and open the <CaseName>Rules_<CaseName>RulesMessageTypes.xsd and verify the import schema of you base payload schema.

It will have the complete path of your payload schema which is the root cause for the above errors (engine is not able to locate the complete path, it should always be relative path)

<import namespace="http://www.example.org" schemaLocation="../C:/XXXX/XXX/YYY/Payload.xsd"/>

Change the schema location to the relative path and the deployment will be successful.
<import namespace="http://www.example.org" schemaLocation="../Payload.xsd"/>

Wednesday, 6 January 2016

Invoking a REST service in Oracle BPM/PCS webform

One of the common requirement in oracle BPM/PCS webforms is to populate the dropdowns by calling a REST service. Below java script code shows populating the dropdown values by calling the REST service.

This code assumes the rest service returns list of items which is name/value pair.
/*member count, items*/
/*member id */
var x;
if (form.load)
{

   Status.value = 'No errors';
   try {
      var uri = "REST_SERVICE_URL";
      eval('x=' + http.get(uri));

      }  catch (e) {
        Status.value = 'got exception' + e ;
   }
   var lovArray = [];
   for (var i=0; i< x.items.length; i++)
   {
      lovArray[i]=x.items[i].name;

   }

   DepartmentsList.options = lovArray;

}

This code assumes the rest service returns just list of values which needs to be displayed in dropdown

/* member items, id */
if(DepartmentsList.value.length>0)
{
  
  try {

      var uri = 'REST_SERVICE_URL;
      eval('x=' + http.get(uri));

      }  catch (e) {
        Status.value =  uri + e;
   }
   approverList.options =x;

}

Monday, 23 November 2015

Invoking a cross domain webservice from jquery

I am going to share the jquery code that I used to invoke a cross domain webservice (for more details on cross domain requests, please click here)

We need to pass following couple of important fields while invoking the cors webservice.

  • dataType: 'json'
  • crossDomain : true
  • and I have the basic authentication as well for my webservice, so I am passing xhrFields.

xhrFields: {   
    withCredentials: true
  }


Here is the full jquery code snippet, 


$.ajax({
 
url:'URL_TO_MY_WEBSERVICE',

headers: {
'Access-Control-Allow-Origin':'*',
'Access-Control-Allow-Headers':'Origin, X-Requested-With, Content-Type, Accept',
'Access-Control-Allow-Methods':'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Max-Age': '86400',
'Access-Control-Allow-Credentials':true,
        'Authorization':setAuthHeader("userName", "password"),
        'Content-Type':'application/json'

    },xhrFields: {   
    withCredentials: true
  },
type: 'GET',
dataType: 'json',

crossDomain : true



Note: My webservice requires the users to be authenticated with http basic authentication. You can see the Authorization uses a method called setAuthHeader() which intern uses btoa() function to generate the base 64 encoded string which is required for basic authentication. Please find the setAuthHeader() source code below,

function setAuthHeader(username,password){
var cred = username +":"+ password;
var basic = btoa(cred);
var hashstr = "Basic "+basic;
return hashstr;

}

Parallel and Serial assignments in Oracle BPM human tasks

In this post I will discuss on parallel and serial assignments of human tasks in oracle bpm.

Parallel assignment:

  • This option will be used when we need parallel approval for a specific task. 
  • Users jack, rose and andy should need to approve/reject the task in parallel.
  • We can specify the list of users as a comma separated string in human task assignment.
  • We can decide the vote outcome by specifying condition on the percentage of the outcome by the parallel participants.
  • In the below example I am setting the outcome as reject even if one of the users rejects (My requirement is it is considered as approved when all the users approve it, if any one user rejects and the task should be considered as rejected).
Serial assignment:
  • Serial assignment is just the task goes to each mentioned users in sequence for approval.
  • users jack, rose and andy should need to approve/reject the task in sequence.
  • We can configure the serial assignment in such way that if any of the users rejects the task then task will not move to the next users. It will directly by considered as rejected.
  • Click on the pencil icon in the assignment tab of the human task.

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.