Is it possible to capture audit history while setWorkflow(false) is still being used

santhoshaitha
Kilo Expert

Hello,

 

We have two tables and each of them has after update Business rules to update values on the other table upon change in value of one of their fields.

Eg:

After update business rule BR1 on table A updates values on table B

After update rule BR2 on table B updates on table A

 

To avoid recursion or looping, we used setWorkflow(false) in both the BRs. But this results in not capturing the audit history of the field values being changed by either of these BRs.

We have already looked into other possibilities to achieve same functionality and still capture audit history but no luck so far.

 

Is there a possibility to capture audit history while setWorkflow(false) is still being used?

 

Thanks and Regards,
Santhosh 

2 REPLIES 2

williamsun
Mega Guru

First check if you might want to disable setWorkflow's twin brother, usually goes everywhere he goes, Mr. autoSysFields.

That is the one that avoids updating the sys fields, but I am not sure if that will also record the rest of the audit you are looking for.

The next thing to review is the "inInteractive" as you might be able to add a condition so that these BRs only trigger when the changes are made by an active session instead of by a background rule or script.

Finally, if the updates are also being generated by non-interactive sessions, then you might want to create a workaround, something like using an unused field for a "flag", so whenever you update table A and BR1 is run to update table B make sure you add a value on one of table B's unused text fields like "dont run BR2".  Then for BR2 add a condition that omits the rule if the field = "dont run BR2", and vice-versa.

Anders Pr_stega
Tera Expert

Hi Santhoshaitha

 

Try using

setUseEngines(false)

  rather than

setWorkflow(false)

Sincirely,

Anders