Event trigger in Workflows

Robin W_
Kilo Expert

Dear all,

at first I'd like to give a big thanks to all of you folks for giving me that much help - I really appreciate this community 🙂

Now the question:

Our consultant created a workflow activity that enqueues an event called "no_manager" to indicate that an user an item was requested for has no manager set in his/her personal data. When the event is fired, an email notification should be sent out to this particular requested-for user. I now had a look at this workflow, the event and the email notification and I noticed that the email notification (called "RITM No Manager") has been set up to use the "Request (sc_request)" Table (instead of the "Requested Item" Table) but if I understand workflows correctly, the no_manager event should be triggered in the Requested Item Table.

In short:

Workflow -> Requested Item Table

Notification -> Request Table

 

Could anyone tell me why this is working although the EMail Notification uses the "wrong" Table? 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi Robin,

the REQ, RITM ans SCTASK are in relationship o2m and in the Wfl, you are able to get details for the REQ although it is on the RITM executing. Same applies for your email. When adding new notification you have fields on your right (check screenshot). This way you share the data which has relationship between the REQ, RITM and SCTASKs. Hope this answers your question 🙂

 

Cheers,

Joro

find_real_file.png

find_real_file.png 

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi Robin,

the REQ, RITM ans SCTASK are in relationship o2m and in the Wfl, you are able to get details for the REQ although it is on the RITM executing. Same applies for your email. When adding new notification you have fields on your right (check screenshot). This way you share the data which has relationship between the REQ, RITM and SCTASKs. Hope this answers your question 🙂

 

Cheers,

Joro

find_real_file.png

find_real_file.png 

Kalaiarasan Pus
Giga Sage

While triggering the event, in gs.eventQueue the object is mentioned after the name of the event in the function. You can pass the object reference to any object from any script. As mentioned above, request and requested item table has a parent child relationship. You can use request field to access the request object and use it to trigger an event on request table.

 

Hope that makes sense.

Okay I understand that in a script there's a possibility to change the calling object but in the Trigger Event Activity in a workflow there's no such possibility so the event should get fired as a Requested Item, correct? But why does it work in this case?

Maybe the EMail Notification itself is smart enough to get the Request object our of the Requested Item object?

Robin W_
Kilo Expert

Okay I think I forgot something to mention:

 

The Event (in the Event registry) has it's table set to "Request" like the EMail Notification has. The only thing I do not understand is the following:

 

The Workflow Activity "Trigger Event" uses "Requested Item" as it's table (like all Workflow Activities do). Why is it possible for the event (that registers to the Request Table instead of the Requested Item Table) to fire? Somehow there must be a transition from Requested Item to Request when the Workflow Activity is reached.