on 2022 Nov 16 7:41 AM
Hi,
I am creating a new business rule in FSM which is deciding if a timeEffort require approval or not.
The business rule have two variables.
1. 'plannedDurationThreshold' which fetches data with this query "SELECT activity.plannedDurationInMinutes * 120 / 100 FROM Activity activity where activity.id = ${new.object.objectId}"
2. 'registeredMinutes' which fetched data with this query "SELECT sum(datediff(minute, timeEffort.startDateTime, timeEffort.endDateTime)) FROM TimeEffort timeEffort WHERE timeEffort.object.objectId = ${new.object.objectId}"
The business rule is running synchronous on Object Create which means the newly created timeEffort is not yet in database, so second variable is not taking this into account.
If the registered time exceeds the threshold then new timeEffort require approval, which is supposed to be controlled with this condition
${moment(new.endDateTime).add(registeredMinutes != null ? registeredMinutes : 0, 'minutes').diff(moment(new.startDateTime), 'minutes')} > ${plannedDurationThreshold}
Something is however not working as expected and sometimes timeEfforts require approval even though registered minutes are not exceeding threshold, and I cannot figure out why.
I now have two questions.
1. Is it possible to enable logging so I can see some details about the value in the variables or maybe the data used in the condition?
2. Does anyone have ideas to a solution for this?
Thanks
Request clarification before answering.
User | Count |
---|---|
5 | |
4 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.