Sunday, November 28, 2010

Validating incoming String of Date format using Regular Expression

I was recently trying to restrict the format of the incoming variable so as to adhere it to the date format like 27-Nov-2010 04:17:37 PM. Well, this had to be pretty simple by using the xp20:matches function that can be used to match a string pattern against a regular expression. I used my function as

xp20:matches(bpws:getVariableData('inputVariable','payload','/ns3:PropertyDetails/ns3:PropertyValueToUpdate'), '^(0[1-9]|[12][0-9]|3[01])[- /.](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[- /.](19|20)\d\d (0[1-9]|1[012])[:](0[1-9]|[12345][0-9])[:](0[1-9]|[12345][0-9]) (AM|PM)$')

Ooops. This was not working and but telling me Internal Xpath Error. Well the reason was that getVariableData() function gets the data from the XML schema element in Object format rather than in String. Finally, all I did was that I used the string() function to convert the object from variable data and it worked without any issue.

xp20:matches(string(bpws:getVariableData('inputVariable','payload','/ns3:PropertyDetails/ns3:PropertyValueToUpdate')), '^(0[1-9]|[12][0-9]|3[01])[- /.](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[- /.](19|20)\d\d (0[1-9]|1[012])[:](0[1-9]|[12345][0-9])[:](0[1-9]|[12345][0-9]) (AM|PM)$')

Just a small learning…

Saturday, November 27, 2010

Provider ABCS not able to read the data while transform, Default Part Name not correct

I started working on AIA 3.0 with SOA 11.1.3.3 and developed a simple Worker interface that fetches the data from a table and transfers it to Provider ABCS.

But while running it, I faced the 2 errors.
The first error that I faced was at the time of compilation. Well, that was seemingly a bug which was worked around.

Later, when I was testing the process, it behaved strange in a way that the all records travelled till Provider ABCS Receive activity properly but did not get Transformed. The Transform activity payload looked empty as shown below. 

  <Invoke_WriteAllWorkersFile_InputVariable>
      <part  name="XxbbIntgWorkersCollection">
           <XxbbIntgWorkersCollection />
      </part>
  </Invoke_WriteAllWorkersFile_InputVariable>
  
I tried various things for this. But later found that the problem was with Provider ABCS. While constructing the PABCS using service constructor, it created the SyncWorkerProvABCSImpl.WSDL (<ProjectName.WSDL>) message part as
  
  <message name="SyncWorkerReqMsg">
        <part name="SyncWorkerEBM"   
              element="eboebo:SyncWorkerListEBM"/>
  </message>

However, looking at the transformation I noticed that actual data is coming into the part with name SyncWorkerListEBM instead of SyncWorkerEBM. Hence as my transform by default was trying to access the data from the SyncWorkerEBM part, it was not getting any data resulting in empty transformation output variable. I changed the above code as following and it worked like a charm.

  <message name="SyncWorkerReqMsg">
     <part name="SyncWorkerListEBM" 
           element="eboebo:SyncWorkerListEBM"/>
  </message>

The same has been raised to Oracle but till they come up with something, we need not stop. Let’s be going…