cancel
Showing results for 
Search instead for 
Did you mean: 

Set Due Date on task in multi-instance sub process

koallen
Champ in-the-making
Champ in-the-making
We are currently on Activiti 5.16

We have a requirement where we schedule a sequence of appointments using a multi-instance called Element. The first task in the called element is a calendar appointment, where the User visits a customer.

This task needs to be synchronized with the User's calendar . This is done be matching the due date on each visit task with a visit appointment on the User's calendar.

Each repeating appointment is  matched by an instance of the called element, the called element is a  sequnce of visit, documenting the visit and submitting the notes for approval.

The repeating appointments are stored by the calendar as an RFC2445 string.

The problem is figuring out the best way to set a different due date for each visit task on the multi-instance element based on the dates generated by RFC2445 calendar.

For example , if there are 4 visits scheduled, the loop cardinality in the called element will be set to 4 , and four sub-processes will be created, however the due date on each visit task must uniquely match one of the set of dates returned by the calendar.

Any advice would be appreciated on how best to pass the visit dates to the activiti engine and how to ensure each created instance gets a unique date for the due date field.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I will guess now.
You have list of dates to meet:
datesToMeet[ date1, date2, date3, date4]
You have to start 4 sub processes by multi instance  behavior where these list is given as input

<multiInstanceLoopCharacteristics isSequential="true"
     activiti:collection="${datesToMeet}" activiti:elementVariable="dateToMeet" >
  </multiInstanceLoopCharacteristics>

in this case you can access dateToMeet variable in the called element.

Regards
Martin

koallen
Champ in-the-making
Champ in-the-making
Martin,

Thanks for the quick response, my challenge is that the multi-instances cannot be sequential, because all dates need to be displayed on the calendar ,so, I am wondering if there  is a way to tell the activiti engine which is the next available date to set as the due date..

Thanks

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

activiti:elementVariable="dateToMeet" works for isSequential="false" too. (if not it's a bug).

Regards
Martin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.