Hi,
I am passing a datatable in a invoke workflow and it is working fine. I just changed the invoke workflow to Launch interactive Workflow, it is not passing the datatable.
It is happening, when i pass SQL connection Object as well.
Hi,
I am passing a datatable in a invoke workflow and it is working fine. I just changed the invoke workflow to Launch interactive Workflow, it is not passing the datatable.
It is happening, when i pass SQL connection Object as well.
Iâm able to pass the DataTable and get the row count in the Invoked WF, although DataRow canât be passed in Interactive Workflow.
Are you getting any error message or you are able to access DT, but having issues with the datatypes?
Have you tried to pass the datatable in launch interactive workflow. I am not getting any error, it just says number of columns as zero. where as, when i use invoke workflow, everything is fine.
What if you call the Main workflow with the Interactive from the start, then use the normal Invokes throughout the rest of your file? So you publish or create a file that all it really does is call Invoke Interactive or initialize some things, then everything else works as how you had it before.
yeah, done that. Its working that way.
Does âdtâ initialized and have any columns? No, i am not gettng any error, it just the columns doesnt exist.
I wonder if the Interactive creates a logon session and loses some variable types in the process, and thatâs the reason.
Yeah, all the string arguments are passed with values, but not datatables and sql connection
Hei,
Noticed that the DataTable is not passed if rowcount is 0. Add a dummy row and try again.
LaunchWorkflowInteractive creates a separate robot process (same as InvokeWorkflowFile with Isolated = true). Whenever youâre passing things across process boundaries, theyâre fully serialized and deserialized on the other side.
Since, as far as I know, Json serialization is used for that (specifically Newtonsoftâs implementation), there are some caveats with passing complex types (assuming theyâre serializable at all).
For dt specific stuff you can check in this thread:
Thatâs correct. Only actual values are serialized and DT schema is inferred on deserialization based on first row values (or in other words - whatever you have in first row will dictate what Type that Column will have after deserialization). If you pass an empty DT, thereâs no data to create columns from.
Just to repeat - from my knowledge this is not a UiPath specific error, itâs from Newtonsoft.Json.
Any other way to smuggle this type of Variables? For eg: Keeping DT in list and Passing?
In the topic I linked thereâs a workaround with binary serialization. You could use other methods that could be more memory efficient, but for the use case back then the most important thing was keeping the structure intact. Whatever you do use, just donât let Newtonsoft serialize it for you (that includes nesting it in other structures, as serialization is determined for each member type separately unless overriden).
Itâs pretty straightforward to add a generic serialization/deserialization activities to make it easier to use across different types. They all still need to be [System.Serializable] though.
Alternatively, one could add custom Json converter for types needed⌠although Iâm not sure how to inject it into argument serialization process without ripping things open.
For passing just the column schema (DT with no rows) there might be a different approach that escapes me currently. But binary serialization should (in theory) work with 0-row DT as well, as it gets the whole object anyway.
Do note that if one of the columns has a type that is not serializable, none of the above will work without further tinkering. But thatâs another beast entirely.
Thanks for detailed explanation. I will try the suggested ways.
Hi there,
one of the other variable types, which is missed using Launch Workflow interactive is Terminal.Connection.
Thats make it hard to implement Launch Workflow interactive within Framework, where Terminal Connection is estabilished within Initialization State machine, and actual processing is done in other State machine.
If terminal is in place, we cannot work in interactive session.
Still Invoke Workflow file activity seems to be sufficient, but once it is not. Is there any workaround how to pass TerminalConnection to Interactively invoked workflow?
Unfortunately - not really. You can only pass types that are serializable via LaunchInteractive and Invoke(with Isolated flag).
You might want to redesign your workflow to move to an interactive session sooner (f.e. as the first invoke directly in Main) and have everything in that. Seems to be working nicely.
Thanks Andrzej,
does that mean, that if there is one Launch Interactive workflow file, then in that workflow there are just âinvoked workflowsâ these are in fact interactive?
Solution might be Launch interactive workflow file - the whole Framework as-is?
Pretty much, yes.
There might be corner cases to that with isolation inside isolation etc., but in general it seems to be working nicely to keep everything invoked down the line in interactive mode.