Prasanna
Prasanna

Reputation: 440

can workflow activity be used as a condition in business rules?

When I try to use the condition

current.wf_activity.name.toString() == "xxxx" it's not triggering the Business rule.

When I try displaying it using gs.addInfoMessage(current.wf_activity.name.toString()); it displays 'xxxx'.

It's also observed that for specific types of workflow the BusinessRule triggers while for others it's not. I have already tried without toString() method which is also not working.

Using getDisplayValue() also doesnt works

Can someone site a good example for using workflow activity in business rule conditions?

Upvotes: 0

Views: 887

Answers (1)

Joey
Joey

Reputation: 2951

It's possible your wf_activity isn't actually set at the time the business rule runs. You may try increasing the order of your business rule to something over 1000 (so it runs after engines) or changing it from a "before" to an "after" rule.

If that doesn't work, remove the condition from the BR and log the current value and comparison result:

gs.log("MYDEBUG: current.wf_activity.name=[" + current.wf_activity.name + "]);
gs.log("MYDEBUG: comparison?=" + (current.wf_activity.name.toString() == "xxxx"));

Upvotes: 1

Related Questions