Selecting 1 out of unknown number

Hi there,
In the diagram there’s a request for tender, which is sent to unknown number of providers and my question is how to model the selection of the best offer (lowest price) of the tenders received within a given time of the first sent request?

Hi Marton,

Ive broken your example into three phases; publish the tender or Request For Proposal, accept responses, evaluate and select responses. Hence in my sample process model, I use a timer event and a non-interrupting event subprocess to accept offers. I then use a multi-instance task to evaluate received offers… Hopefully this model gives you some ideas…

regards

Rob

3 Likes

Hi Rob,
Thank you very much it helped a lot as it’s way better then what I made, and I’d be grateful if you could model the multi-instance part for me as that gives me a headache and is required. (I’m a student and need this for my exam)
Thank you!
BR,
marton

Hi Marton,

At a descriptive level, all thats required to model the multi-instance is the annotation of the three bars at the bottom of the task as per the model Ive given. (see more here)

For an executable model, you would need some code to help iterate or loop over the responses. For example, you could add a service task before the evaluate task to count responses, eg ‘Select count(*) from Response’. This value could be used as a process variable to control the number of evaluate instances.

Within the evaluate task, Camunda provides a built in process variable called ’ loopCounter’. Hence to load the response associated with that instance, you could use some code like;
‘Select * from Response where rownum = loopCounter’…

There are lots of other ways, I hope this gives you some starting ideas…

regards

Rob