Need help converting scripted activity in Workflow to and Event in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 12:02 PM
I am converting a workflow into a flow, but I've run into a problem that I need help with. I'm hoping there is an OOTB solution and I can avoid writing yet another custom action.
We have a custom table (Division) to break down the OOTB Department table further. On the division table is a field called Liaisons that is of the type "List", which references the User table. The liaison field can have one or more users in the list.
In one of the workflows, there is a Run Script step that looks up the division and gets a list of liaisons in order to send an email to each individual. So far, I've been unable to reproduce the functionality in Flow and I really don't want to write another custom action if I don't have to.
The workflow script is:
This is the error message I get if I use Fire Event - really not helpful.
class com.snc.process_flow.engine.serialization.GRProxy$1 cannot be cast to class java.lang.String (com.snc.process_flow.engine.serialization.GRProxy$1 is in unnamed module of loader com.snc.orbit.container.tomcat8.Tomcat8$OrbitTomcat8ClassLoader @1a35dd74; java.lang.String is in module java.base of loader 'bootstrap')
Does anyone have a solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 12:14 PM
Hi @gjz,
I assume you are using Parm1 as the list of Who in the notification. In this case do you need to split the list? Wouldn't you simply want to cast the list to a string and add that as the Parm1 as a string value of sys_ids?
Can you attach a screen shot of the execution details? It sounds like your list is not being cast to a string properly from the datapill. One way to fix this without looking close may be to create a flow variable of type string and store your list value in there first then use that datapill in the event Parm1.
Thanks,
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 01:43 PM
The list is split - which is why I used the function for Parm1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 01:48 PM
It looks like the data is being passed to the action.
What input is the action you are using expecting though? Is it string? If so you need to pass it as a string and parse it in the action using a scripted step since the output of the split is an array.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 01:55 PM
Another "workaround" to using a list with the Fire an Event action is to script firing the action in a Pause action. See the screenshot below for an example.