• Entries (RSS)
  • Comments (RSS)

Running a correlation set

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 23-07-2008

Tagged Under : , , , , , ,

Running a business process that contains correlation set.

My previous post was about creating a correlation set using WID. Today my post is about running a correlation set using BPC explorer. Unlike running a process or human task, running a process that contains the correlation set is little tricky.

Starting a business process is straight forward. Just logon to your BPC Explorer (The url will be http://localhost:9080/bpc/ unless you have changed the default port while installing the process server.). And click on ‘My Processes Templates’. It will list all the available process templates. Select your business process template and click on Start Instance. From the new page appeared enter a name for your process if you want and enter the process input message and submit. Your process will be started. The input we have given will be for the first receive activity.

Now if you look into the process state, the first receive activity will be finished and the second receive activity will be waiting in a waiting state. I.e., now the business process is waiting for the second receive activity to be invoked.

To invoke the second receive activity, click on the link ‘Started by me’

Processes started by me

Processes started by me

Click on your process instance. In my case I had given the name ‘testHello’ when starting the process. This will take you to the Process instance details page. Now click on the ‘Events’ tab.

Process Instance

Process Instance

We can see an operation is listed there. This will be the operation associated with the second receive activity. Click on that operation and we will be taken to the ‘Send event’ page.

Send Event

Send Event

Enter the name you have entered while creating the process and click on Submit.

You are done. Your second receive activity also got invoked.

Thanks Richard W Gregory for teaching me how to run a business process that is having a correlation set in it.

Creating a correlation set WebSphere Integration Developer

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 21-07-2008

Tagged Under : , , , , , ,

This is something I was planning to post for a long time. Due to some or other exceptions I was getting, I couldn’t make it till today. Today’s post is about creating a correlation set in WebSphere Integration Developer. In my example I used a new module for creating the correlation set.

A correlation set is used for associating an external message with the correct process instance. To create a process that is using a correlation set first create an interface with two operations. In my case I am planning for a business process with two receive activities. My interface looks like the one shown below.

Interface

Now create a new process using the interface we created in previous step. Use the sayHello method as the operation for this process. Make sure that you have made this process as a long running process and add a second receive to this process. Finally after adding all the elements the business process would look like this.

business process

business process

Don’t worry about the error messages. Set the TestInterface as the partner for the second receive activity also. Select printName as the method name. Now most of the errors will be disappeared. However still there will be some errors present and it is because we don’t have a correlation set defined for the second receive activity. So now it is the time to define a correlation set. To create a correlation set for the business process follow the below steps.

1. Click on ‘Add correlation set’ icon next to Correlation sets from the tray.

Add correlation Set

Add correlation Set

2. Enter the name you want and select it.

3. Click on Details from properties window.

4. Now create a correlation property.
4.1. Click on Add
4.2. From th ‘Select Property’ window, click on New.
4.3. Enter a name for your property.
4.4. Click Browse and select the type of your property.
4.5. Create an Alias by clicking on New button next to Aliases label.
4.6. From ‘Create Property Alias’ window, select the interface and the operation.

Create Property Alias

Create Property Alias

4.7. Repeat it from the second operation also.
4.8 Click on OK

Create Correlation Property

Create Correlation Property

5. The correlation set is ready now. The next step is to associate the correlation set to the receive activities.

6. Click on Correlation from the first Receive activities’ properties area.

7. Click on Add. The correlation property will be added. Select initiation property as Yes and direction as Receive.

Recieve correlation

Receive correlation

8. Click on second receive activity and add the correlation property. Here set the initiation property value as Join.

8. Build the project. Now all the errors will be disappeared from the module.

com.ibm.bpe.database. TomDuplicateKeyException: (com.ibm.bpe. database. CorrelationSetInstanceB: PNUDx)

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 17-07-2008

Tagged Under : , , , , ,

CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method “bpc_invoke” on bean “BeanId(XXXApp#XXXEJB.jar#component.XXXX, null)”. Exception data: com.ibm.bpe.database.TomDuplicateKeyException: (com.ibm.bpe.database.CorrelationSetInstanceB: PNUDx)

This is the exception I got when I tried to send an event to an operation. The complete stacktrace of the application is

CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "bpc_invoke" on bean "BeanId(XXXApp#XXXEJB.jar#component.XXXX, null)". Exception data: com.ibm.bpe.database.TomDuplicateKeyException: (com.ibm.bpe.database.CorrelationSetInstanceB: PNUDx)
PIID                          = _PI:9003011b.356b88eb.dfa2c038.977f0038
COID                          = _CO:9024011b.356a6d43.dfa2c038.977f0020
SIID                          = _SI:9010011b.356b8a14.dfa2c038.977f0043
processName                   = XXXX
PTID                          = _PT:9001011b.356a6d43.dfa2c038.977f0016
status                        = ACTIVE
hashCode                      = null
data                          = null
dataLong                      = null
versionId                     = 0
(com.ibm.bpe.database.CorrelationSetInstanceB: Pnudx)
PIID                          = _PI:9003011b.356b88eb.dfa2c038.977f0038
COID                          = _CO:9024011b.356a6d43.dfa2c038.977f0020
SIID                          = _SI:9010011b.356b8a14.dfa2c038.977f0043
processName                   = XXX
PTID                          = _PT:9001011b.356a6d43.dfa2c038.977f0016
status                        = ACTIVE
hashCode                      = [B@6bbd689b
data                          = CS-CorrelationSet-Val=Albin1_/
dataLong                      = null
versionId                     = 0
	at com.ibm.bpe.database.TomCacheBase.addOrReplace(TomCacheBase.java:226)
	at com.ibm.bpe.database.Tom.newCorrelationSetInstanceB(Tom.java:11040)

This error was because the Correlation Sets initiation property was set to Yes. If the initiation property of correlation set to Yes, it will create a new process instance with the correlation value if the receive is invoked. So I believe in our case WPS was trying to create a new process with the same id. That could be the reason for that TomDuplicateKeyException. Anyways this issue got resolved when I changed the initiation property value to join.

Correlation sets

Posted by | Posted in Websphere Process Server / Integration Developer | Posted on 30-05-2008

Tagged Under : , , , , , ,

Correlation sets.

Correlation sets are used for associating messages from outside the process to the correct process instance. Usually correlation sets are used with state machines. However we can use correlation sets with business processes also. A long running business process can have and will have more than once instances of the processes running at a time. If an external component is sending a message to this business process, the message needs to be passed to the correct instance. This is accomplished with the help of correlation sets. Or in other words a correlation set tells which message is associated with which process instance.

The problem came because the web services are loosely coupled and it’s not easy to identify the correct process instance from a client application. Or if a business process has two receive activities, we need to know which instance should receive the message.

A correlation set will have one or more properties and aliases. If a process is expecting different messages, we will have more than one property. A collection of such properties are called correlation set.