Saturday, December 4, 2010

How to configure Roles and Users in Oracle BPM??

I have just started working on Oracle BPMN and it's a perfect product for modelling business processes.
The first challenge which i surfaced while working on BPMN was how to configure Users for particular Roles.I could see that the task was getting automatically assigned to ProjectName.ApplicationRole
I tried everything starting from LDAP setting to Administrator Console configuration but i could not figure out why every task was by default getting assigned to weblogic(default administrator)???
I did some R&D and then at last bingo!! i was able to get it going......
To Configure Users,you need to do following:
1)Open Enterprise Manager http://localhost:7001/em
2)Expand Application Deployments under your domain(base_domain default)
2)Select any deployed Application and right click on it.

3)In my scenario,i have selected MakerTaskFormUI
4)Right click on it and select Security

5)Under Security Select Application Roles
6)The Application Roles page will open up.
7)Select Application Stripe to Search
8)From the drop down,select OracleBPMProcessRolesApp


9)You will notice that,all the roles will be visible as YourProjectName.Role
10)Select the role for which you want to assign user.
11)After clicking add the user and do not forget to click on OK for each entry.

12)On adding each entry for different roles,you'll see something like this for your application.
13)Go on and test,it should work fine.

How to Integrate SOA With ERP(JD Edwards,PeopleSoft,etc)??

You might have come across situations where you need to integrate Oracle SOA with ERP like JD Edwards,People Soft,SAP etc...
There are two approaches for this:
1)Application Adapters
2)Dynamic Connectors


With the first approach,you just need to install Oracle Application Adapters,follow the installation guide for it and you'll be able to configure it for integration as it discusses about all the requirements,jdeinterop.ini in case of JD Edwards,configuration...GenJava stub...classpath etc..So,it's not worth writing about it on this blog.

The second approach involves,writing the java code in a class and using a Java Embedding in the BPEL in order to meet the requirement.It can be tested individually as well, but as we need to integrate, so it should be called from somewhere and BPEL makes this possible.
In case of of JDE.it requires DB2 client installed on the machine from which the call to JD Environment will be made,and the dependent libraries and jars.
While compiling the code containing BPEL to call the JDE environment, you might encounter an error: Jars could not be found in the BPEL Classpath.
This occurs because at the runtime BPEL looks for the location from where it could pick the dependent jars to hit JDE.
For this you need to do following:
1)Open enterprise manager http://localhost:7001/em
2)Right click on soa_server1

3)Select SOA Administration
4)Then BPEL Properties


5)BPEL Service Engine Properties will open up
6)Click on More BPEL Configuration Properties

7)Under The Attributes Tab,look for BPELcClasspath


8)Enter the location of the jars in the value field


9)Click on Apply and now compile your project containing Dynamic Connector,Java Embedding in BPEL.
I am sure you wont get any errors...



Tuesday, October 12, 2010

HOW TO MANAGE TRANSACTIONS IN OFM SOA SUITE?

Transactions are part of day to day activity,either booking a online ticket or withdrawing cash from ATM..each and every transaction should be managed so as to compensate the non-availability of any service and to rollback the action performed.,say for example while planning a holiday if money has been debited from your account for hotel booking,renting a car etc but if the Air Ticket is not available then.....
Money should be deposited back into the account..
To manage these scenarios,SOA Suite provides two ways to manage transactions..

First is by using Compensate Handler Activity.
Second by using Global transaction property.

The first scenario involves writing down reverse business logic for compensating the particular event,what you have to do is
Add compensate handler to the scope which needs to be Compensated in case transaction fails
Write reverse business logic inside it for compensating(for eg if transaction involves 3 separate DBAdapter calls for inserting data in different dependent tables,and you want to reverse everything in case any of them fails.)
Add a throw activity in the same scope(lets say Scope2) to throw the exception
Add a catch branch in outer scope say(Scope1),catch the exception and add a compensate activity with scope set as  Scope1
Deploy and test,if Business logic has been written properly your transaction would be compensated.

The Second way is based on the concept of Global Transaction,each composite in itself starts a new transaction when it is called whether it involves 1 or more BPELs

There is a property
<property name="bpel.config.transaction" many="false" type="xs:string">requiresNew</property>
This has to be set in the composite under the particular BPEL component tag.
This makes sure that at the point where the particular BPEL containing transaction is invoked,the current Global Transaction is paused and new one is started and only after successful completion of the particular BPEL,Global Transaction is resumed from the point it let off.
Whenever BPEL containig transaction throws the error,the transaction gets automatically rolled back.
Simple isn't it?

Thursday, August 12, 2010

How to translate data separated by pipe ( | ) in XML format?

You might encounter a scenario in which the child node of an xml contains data separated by some pipe e.g.( | ) and you want to translate it into proper xml structure for further manipulation.

Well,in my previous post i mentioned about pipe ( | ),and in this post i'll tell you how to separate data and translate it into xml.

       For this situation,Oracle SOA suite provides a BPEL xpath manipulation function called
                                                                      ora:translateFromNative( )

The input parameter of this function is a) input variable containing data to be separated by pipe( | ) and
                                                          b) nxsd template which will be   'xsd/filename.xsd' containing nxsd style xsd


You can get the data by using
ora:getChildElement(bpws:getVariableData('Invoke_Array_OutputVariable','ArrayReturn','/ArrayReturn'),1)
where 'Invoke_Array_OutputVariable','ArrayReturn','/ArrayReturn' is the variable containing data separated by pipe and  1 represents the first node...

I am sure this migght be helpfull if you get stuck in same position where i got stuck
          

Wednesday, August 11, 2010

Does SOA11g provides support for a Webservice based on Jax-RPC returning Two-dimensional array?



My answer would be no....as i have surfaced a situation in my recent project in which the webservice was returning a two dimensional String array String[][],i tried alot to pass the data to the Human Task but to no avail...
BPEL could not recognize it,so i modified the code of the webservice and returned String[] containing records as a single String wherein multiple records were separated by pipe( | ),i could separate the data by using xsd type nxsd,but the main issue still remains that all the records were in single node.
You can use   
                    ora:getChildElement(input variable,index)
                                   
                                       where input represents the output variable of your invoke service and index represents which record you need to fetch,if you'll try using count( ) function it will return 1( for rpc-soap encoded webservice) dont know about rpc-literal.....
But the main issue will come while assigning that string variable containing the result in XML Element as in order to pass the record for approval the data should be in XML format.....
I am still doing R&D,if i'll get some solution,i will post it ASAP....
I have the xsd based on nxsd style to separate data from pipe( | ),if anyone of you needs it just let me know i'll post it as well