Powered By Blogger

Tuesday, December 21, 2010

Processing XML input payload without namespace

Sometimes we come across situations like BPEL receives an XML without any target namespace defined it and BPEL has to transform it to different format. Assume that the XML it receives is generated by third party application which is not in our control.Given this scenario we have no option of changing source input XML but we have to change the BPEL code to work with XML payload without name space associated with it.By default BPEL always works with payloads which has name space associated with it.

Brief steps to achieve this
  • Remove target namespace attribute from xsd which is modelled to validate incoming xml
  • Keep default namespace attribute in xsd
  • Remove any namespace prefixes pointing to xsd default namespace from xsl file
Example:

Assume that BPEL receives below xml as input
<invoices>
<invoice>
<invoiceNumber>1234 </invoiceNumber>
<partNumber>AELWF</partNumber>
</invoice>
</invoices>

 
By default BPEL generates below xsd to represent above xml

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org"
elementFormDefault="qualified">

We need to remove targetNamespace from above xsd

<?xml version="1.0" encoding="windows-1252" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns="http://www.example.org"

elementFormDefault="qualified">

Remove any namespace prefixes in xsl files.

Now we can deploy BPEL process

There might be many other ways to achieve this, but I feel this approach is simple.

Sunday, December 5, 2010

ORABPEL-10101-Error while updating the task.ORA-12899: value too large for column "ORABPEL"."WFTASK"."PUSHBACKSEQUENCE" (actual: 201, maximum: 200)

This error has something to do with your human task updating by task service.Though this may occur in many ways, I will explain one use-case where I received this error.

pushback sequence: This is workflow internal mechanism to keep track number of times task has been updated. This is also used in pushing back assigned task to previous approvers or original assignees users from which it came.it is defined in

Schema-ORABPEL
Table-WFTASK
Column-PUSHBACKSEQUENCE

Our environment description

We have a polling bpel process which polls staging table and closes certain human tasks when specific criteria meets.

We have set 2 mins as polling frequency for this BPEL process.Due to this less polling frequency time, process used to gets executed very frequently and this led to a scenario where new instances getting created before completing old ones and all of them trying to do same task i.e closing human tasks if some criteria was met. At certain point in time there were few hundred processes running and all of them tried to access same task and were trying to close the task.Considering our environment, for us this is something timing issue.
Ultimately this led to data base level locks and violation of database level constraints like

Whenever task is modified then extra sequence is being appended to pushbacksequence.

Lets say initially when task is created we have sequence =>1-3
then when any operation is performed on it then it will become 1-3-5-7, like this for each operation it goes on adding sequence.

After few attempts it became length of 201(1-3-5-7........127) and database column is defined to hold only  length of 200 characters hence the error.

Exact error we have seen is

10/12/02 11:06:19 java.sql.SQLException: ORA-20002: Error while updating the task


ORA-06512: at "ORABPEL.WFTASKPKG", line 1034

ORA-12899: value too large for column "ORABPEL"."WFTASK"."PUSHBACKSEQUENCE" (actual: 201, maximum: 200)

ORA-06512: at line 1