- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2020 10:57 AM
Dear all,
On my personal dev I'm trying to automate part of the lifecycle activities by creating a flow which is triggered at a specific point in the activity set. However, I am not sure how to configure it. I checked the documentation (https://docs.servicenow.com/bundle/orlando-hr-service-delivery/page/product/human-resources/task/configure-hr-lifecycle-event-activity.html#configure-lifecycle-event-activity-flow) which is not very specific so i was hoping you could help me.
I can configure a lifecycle activity of type "flow". Do i attach a "flow" or a "subflow" to this activity? Both are available from the list.
If i attach a subflow without parameters, i get the error shown in screenshot 1 (incorrect parameter configuration).
I will, however, need to pass parameters of the case to the subflow. When i tried to configure parameters, the same error occured. WHen i attach a subflow with input parameters, i do not see how i can specify how parameters should be filled.
Is it possible that in the context of the subflow i have access to the current case record? How can i configure Input paramters on the subflow and fill them using the "lifecycyle activity"?
If i have to use a regular flow, i would like to know how to trigger it. The flow needs a trigger of type "created" or "updated", if it is not a "service catalog" flow. However, i want to trigger the flow from a specific point in the life cycle events (triggered in a specific activity set). I do not think that a Flow on the HR Case table will trigger at the right moment if i select "update" with some conditions.
Could you guide me through the correct way to trigger a flow or subflow from a lifecycle activity?
Thanks in advance for your assistance.
All the best,
Ward van Hoof
Solved! Go to Solution.
- 4,544 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 12:23 AM
I logged a HI ticket and this problem article was linked. Using the information below helped me to trigger the flow (though there's no relation from the flow to the case / activity which triggered it)
PRB1381783
In addition to the above issue, the The following additional limitations / issues have been identified:
1) Results in a runtime error if the configured Flow does not have "user" and "job" inputs defined (LE Activity configuration currently allows you to select any active, published flow including ones without these parameters).
2) Results in a runtime error if the configured Flow is not a Subflow (LE Activity configuration allows selection of both flows and subflows)
3) Default Inputs to the subflow for the parent case and lifecycle activity are missing, which would be relevant contextual information for many general use cases
4) There is no tracking mechanism in place to keep the Lifecycle Activity active while the subflow is still running
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2020 08:30 AM
Hey,
Did you ever figure this out? I am stuck on the same thing. Have spent so much time on these flows/subflows trying to implement them inside an activity set that it is driving me crazy! 🙂
Thanks for your advice up there, I no longer get a strange error that I was getting before (even though everything worked). I am also now stuck at how to make the activity set understand that it is finished.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2020 11:51 PM
Hi,
You mean to auto close the case? Not quite, but this is my work around.
There is a scheduled job running every 24 hours, which will close all cases with services marked "automatically close". However, this job only closes the case if one or more tasks related to the case have been closed (so a case consisting completely of automated processes will not be closed). (scheduled job is named "auto close case")
My work around: dummy task with a business rule to automatically close the dummy task. this will result in the scheduled job closing the case. (keep in mind, the state of the flow is not considered at all. Maybe closing the task at the end of the flow might be better?)
Something else you might try: moving the case to "awaiting acceptance". I believe that OOTB it should be closed after 7 days.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2020 06:49 AM
I figured it out just a bit before you replied but thank you!
I noticed that I was getting things created 4 hours after I ended the flow so it turns out there is a timer. Go to Executing Activities and find the one that is 'Wait before checking if activities are closed' that corresponds to the record you just created. In the scratchpad you will see a Workflow###############. Take that exact part of the scratchpad and put it into Scheduled Jobs under System Scheduler. You will see that the time is 4 hours ahead (I don't know for what reason).
You can change this time to suit your needs but I heard you should not be messing with it in production. We have decided that people can wait four hours for the next task so it is okay for us.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2020 12:23 PM
Hi Daria,
Building on your reply, i did some more digging.
The script include "sn_hr_le.hr_ActivitySet" has a function "getLoopInterval" which uses the property "sn_hr_le.All activity set closure timer" (integer, hours) to determine the close scheduler (default = 4)
You might want to experiment changing this property to 1 (i would not recommend moving it to 0)
EDIT: and the servicenow documentation: https://docs.servicenow.com/bundle/orlando-hr-service-delivery/page/product/human-resources/task/lifecycle-event-properties-page.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2020 12:25 PM
I literally just found this like 20 minutes ago!! Perfect 🙂
