cancel
Showing results for 
Search instead for 
Did you mean: 

Logging variables of business rule when executing

ThomasRyegaard
Explorer
0 Kudos
401

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

Accepted Solutions (0)

Answers (0)