cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to make a receiver step return immediately?

Former Member
0 Kudos

Hi everyone,

I am implementing a model with a loop to handle multiple messages. if there is a message meets requirement, the loop exits. but there MIGHT be other messages parked and I need to notify the sender of the message not being processed.

so i am thinking to add another loop to receive parked/unprocessed messages. but it's possible that there is NO parked message at all. so the receiver in the last loop should be able to return immediately regardless there is parked message or not. in window programming, there is an API to receive message from system message queue without waiting. so my question is: is it possible to have a receiver without waiting?

besides the no waiting receiver, i am open to any other suggestion that can solve my problem.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Stephen,

Since request message would uniquely identified by the change request number, you can <b>use correlation based on the change request number</b> to handle individual instance of the process separately.

So, although a <i>buyer</i> can send multiple requests, and only some of them might be processed completely and acknowledged back, the remaining will remain in processing state until they are completed. This is the advantage of using correation.

Regards,

Message was edited by:

Shankar Bhate

Former Member
0 Kudos

What happens if there are still parked messages while the BPM process stops? Will the parked message starts a new BPM process? Thanks!

Former Member
0 Kudos

Hi Stephen,

>><i>

but there is one more parked message remaining unprocessed. I need a method to handle it by notifying the buyer that this change is not processed.

>></i>

Correlation takes care of this.

You do not have to worry about parked messages. The parallel 'instance' of BPM for the parked message will continue to run until the process finishes.

Regards,

Former Member
0 Kudos

Thanks Shankar,

How does multiple instances work in BPM? Is a instance like a thread, or like a process?

In the case of parked messages, will they activate yet another instance of BPM after the existing instance stopes?

Former Member
0 Kudos

Hi Stephen,

Instance is like an object created out of a class in OOPS terminology.

I think it is a separate 'thread' that gets created.

We create a BPM (say with correlation in this case) as a model. However at runtime, different 'instances' or 'copies' get created based on incoming values of the correlation field.

Suppose buyer sends a change reuest. This will generate one BPM instance. Now this will continue till it gets finished (as per the terminating condition given in BPM) Suppose the buyer sends again another request, then another instance of BPM will get created and get processed independently.

>><i>

In the case of parked messages, will they activate yet another instance of BPM after the existing instance stopes?

</i>>>

The instances are independent of each other. So starting of one will not depend on whether some earlier instance of BPM has stopped or not.

Regards,

Former Member
0 Kudos

Thanks Shankar,

Very helpful explanation for me to understand BPM from OO way.

Based on my understanding, I have a slight different opinion regarding the instance creation of the BPM. Whether another instance gets created depends on how correlation is defined. If correlation is on PO number and the second change request has the same PO number as the first one, then no "another" instance gets created when the first instance is still running. If the second change request is NOT "correlated" with the first one, then another instance gets created.

If my understanding is correct, then how can we handle the following case:

1. the receiver step starts correlation on PO number

2. the first change reqeust and the second change request have the same PO number. the second change request is sent right after the first change request.

3. the first change request gets confirmed and the instance stops. But there is one parked message.

Will the parked message starts a new instance? or it just gets ignored. I prefer to have a single instance and notify the sender of the parked message that it won't be processed. If the sender wants it to be processed, it knows it should send a new message to start a new instance.

Thanks!

STALANKI
Active Contributor
0 Kudos

Stephen,

What is the business requirement that is driving you to park the messages?Why you need to do that?

Former Member
0 Kudos

Hi Sravya,

I don't want to park any message. But the sender of messages is out of BPM control. For example, a change request is sent to BPM from buyer and before the seller reply the buyer send another change request. The first change request gets confirmed and formal processing should be over, but there is one more parked message remaining unprocessed. I need a method to handle it by notifying the buyer that this change is not processed.

Please let me know best practice to handle this situation. Thanks!

Former Member
0 Kudos

Hi,

If I got your query right, you want to collect all the requests from a particular buyer and send it to the seller at one go?

If so, you could make the BPM wait for a specified time period, collect all the incoming request from the buyer, and after sometime, send the requests to the seller.

Regards,

Smitha.