Import arguments in "Invoke Workflow File"

uiautomation
studio

#1

Hi,

We made a lot a sub-processes that we call with the “Invoke Workflow File”. To call them, we want to use a string variable to specify the “WorkflowFileName”.
ex : strPath + “\test.xaml”
But in this case, the “import arguments” function does not work anymore.

Is there a mean for this “strPath” variable to be “readable” by the activity in order the “import arguments” function works well ?

Thanks and regards


Hold progress of the workflow depending on the value of a variable
#2

Hi @nicolas.roussel,

Please check if this variable was created as an argument in the workflow that you are calling and also check its direction because if you need to use it later you’ll have to define it as In/Out. Also, whenever we add an argument to the workflow we are calling, we need to save it before trying to import the variables in the Invoke Workflow File activity.


#3

Hello Nicolas,

so you are trying to assign to strPath the current logon user? and then pass it to another workflow?

do the following,

that way you can have the “variable” passed from workflow to workflow

Here is an article about it.

regards,


#4

Hi acacioelo,

Maybe I was not clear.
I perfectly know the use of variable in both way (at least I think so :slight_smile:).
I’m specifying the “WorkflowFileName” with a string variable : strWorkflowFilePath + “\text.xaml”
It works perfecty to call this workflow when I run it.

My issue concerned the “import arguments” function which does not work anymore with this kind of call (certainly because it doesn’t know what is “strWorkflowFilePath” when it is not running).

Do you know a mean to make it works ?


#5

Hi Beesheep,
thank you for your answer.
As explain just before, it is not concerning the pass of variable between workflow, I manage this.
It is just the “import Arguments” function which does not work anymore when I specify the WorkflowFileName with a variable like this : strWorkflowFilePath + “\test.xaml”
Regards


#6

Hello @nicolas.roussel

I think the best solution here is not to use a String as a file path.
Instead, you create a Flowchart with some Flow Decision activities to create the necessary logic to call the diferent Workflow Invokes.

I think it would increase readability of your artifact and solve the issues with the Arguments.

Regards


#7

Yes, import arguments will not work in this case as a variable is instantiated only at runtime while import should know what to import at design time.

You’ll have to set the arguments manually in this case.


#8

Hi Badita,
So I have others questions for you.

Our context : we will have lots of processes calling other sub-processes (for managing Excel, Email, open/close application… etc)

Questions :

  • if we need to change the location of xaml files, we don’t want to change the hundreds of “invoke workflow file”, that’s why we use a variable to specify the path.
    How to manage this case in UiPath and keeping the “import arguments” functionnality ?

  • if we change/add/remove an argument in our sub-processes, how can we see the impacts on other processes that call it ? In the same way, if UiPath update arguments of an activity, is there a mean to see the impacts ?

many thanks
regards


#9

Badita,
Could you please have a look at my last questions ?
Thanks


#10

Sorry but this doesn’t make much sense to me. The documentation on “Using Argument” also makes little sense. Can someone please explain how to pass in an argument into a workflow, then how to handle it in said workflow?

For example:

I have a variable (an int) within a workflow that I want to pass into an InvokeWorkflowFile .xaml file that contains a sequence. I want to understand how I can pass it into this file and how I can handle it within the sequence and use it.

Thanks


#11

Let’s try to put it in other words:

An Argument acts like a Variable inside the workflow it is declared in. This means that inside that workflow, you can use it the same way you would use any other variable. Functionally there’s basically no difference.

But, an Argument also interacts with it’s calling workflow.
InArgument gets the initial value from the Invoke.
OutArgument returns it’s last value through the Invoke.
InOutArgument does both.

So, in practice:
Main.xaml invokes Child.xaml
Child.xaml has an InArgument(Of Int32). Whatever is passed as the value for that Argument will be it’s starting value (it can be changed inside the workflow).
Child.xaml has an OutArgument(Of Int32). Whatever is the last value of that Argument will be passed back to Main.xaml and stored in the variable you put there.
Child.xaml has an InOutArgument(Of Int32). Current value of the variable you put will be passed as the starting value and whatever the end value is will be stored back in Main,xaml in that same variable.

I don’t know if that clears anything, but hopefully at least the first part will be understandable.


How to associate with parents workflow automatically using by Invoke workflow file
#12

I understand the concept of it and how it works, but I do not understand how to physically make it happen in UiStudio - a couple of screenshots of it being passed into the Invoked workflow and used within the workflow would be awesome


#13

Chris, take a look at this… play around and let us know…

blueprintChris.zip (3.4 KB)

:slight_smile:


#14

I use switch to call out different workflow. Try using that, it will work!


#15

Exactly what I was looking for. Many thanks!


#16

Hi, I need to know how can we pass the path of an excel file which is created by workflow 1 to workflow 2 as an input using argument? Please let me know if anyone knows.

Regards,
Komal


#17

Hi, How can this be done? Can you please elaborate? I have 2 workflows(2 xaml) and I need to pass the path of excel file which is created at the end of workflow 1 and pass it to workflow 2. I tried using arguments but it’s throwing exception for path with null value. Please let me know if you the solution this.

Regards,
Komal


#18

Why is argument1 value is not same in both the workflows?
Can you help me how to pass value from one workflow to other


#19

Hi
Below is the tutorial for invoke workflow file