Announcing the Global SNUG Board of Directors. Learn more here

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Conditional Lifecycle Event Activities

Michael C1
Giga Contributor

Hi all,

I'm trying to build a Lifecycle Event which has numerous Activities which need to be created or not created based on conditions of the Lifecycle Event Case record itself.

Example:

LE Case created with a checkbox field on sn_hr_le_case. Based on the value of the checkbox, how can an Activity be conditionally triggered? Not an Activity Set - that's easy due to Advanced Trigger type allowing scripted conditions. But I can't see a way to use script nor condition builder for individual Activities.

I can see HR Criteria, but can I use this to query the value of the fields on the current LE case record? It seems like HR Criteria is for things like users department, location, etc. Can I somehow use this to refer to the current sn_hr_le_case?

Thanks in advance for any advice!

Regards,

Michael

4 REPLIES 4

jayesh mohan2
Mega Expert

Michael,

Ultimately it looks like you are trying to trigger HR Services based on a field on the LE Case. I think the best approach for this is to create an activity set and base your trigger conditions on the activity set than trying to add them on the activities. It is possible to add a complex HR Criteria, but that would not be ideal is my opinion. On the other hand, advanced conditions on the activity set provides the GlideRecord to the parent case and I believe you can use this to check if your checkbox is true/false to make a decision.

Vinay Mishra3
Kilo Guru

Hi Michael C,

We can not put the condition on activities, You can create separate activity set with conditions ans put those particular activities under that activity set.

 

Please mark correct/helpful if its applicable for you.

 

Thanks,

Vinay  

Michael C1
Giga Contributor

Thank you Jayesh and Vinay for your responses re: using Activity Sets for this conditional logic. I am currently using that technique. However, the downside is that the Lifecycle Events will have a very large amount of Activity Sets, each with only a single Activity. This leads to a poor experience (eg in portal, from end-user point of view) and also makes the Lifecycle Event vary hard to maintain due to complex linking of dependant Activity Set sys_id's and the conditions of previous dependent activity sets

For example, one Lifecycle Event has over 20 Activity Sets, each with 1-2 Activities. Some of the Activity Sets need to run in parallel, some in sequence, and almost all with criteria that requires GlideRecord lookups to various tables.

Due to this this structure, adding in a single conditional task at one point results in modifying multiple Activity Set triggers (i.e. the activity set after it, and potentially many activity sets that 'join' parallel branches).

It's a shame we can't just use script and/or workflow editor in Lifecycle Events. Or simply use script as a condition for a single Activity only (not full set).

At this point my recommendation to the client is to not use Lifecycle Events at all, and instead use Workflows in a custom app.

Community Alums
Not applicable

I agree with you Michael, there should be a way to put a condition on a Lifecycle Activity. I am on New York, and I don't see how to do that (except by using Audiences/HR Criteria) even though there is a reference to such capability here. Another reason we need conditions is to facilitate the handling of an Approval Activity in a Lifecycle Event. I can't see how to handle a rejection appropriately if there aren't easy conditions to put on subsequent Activities. And on a rejection, we might want to go back to an earlier Lifecycle Activity, jump over several activities, or end the entire Lifecycle Event immediately, not just resubmit the current Approval Activity. It seems there are some gaps in the Lifecycle Event capabilities.