I am trying to invoke.xaml files dynamically using Invoke Workflow Files. But I am stuck when passing arguments. For Ex: FunctionA has two Arguments ParaOne,ParaTwo, FunctionB has Two Arguments ParaThree,ParaFour.Now when loading dynamically following Error Thrown. If I declare arguments ParaThree and ParaFour in FunctionA and Declare Arguments in ParaOne,ParaTwo in FunctionB then workflow executing smoothly. That means all 4 Arguments need to be declared in all xaml files. Please help.
Message: The values provided for the root activityâs arguments did not satisfy the root activityâs requirements:
âFunctionAâ: The following keys from the input dictionary do not map to arguments and must be removed: ParaThree, ParaFour. Please note that argument names are case sensitive.
Parameter name: rootArgumentValues
The thumb rule is the number of arguments must be same and datatype also should be same across workflows. You have two options
(a) Make sure all the workflows have same no of arguments , by adding dummy arguments
(b) You can have a single argument across workflows, in case of more than one argument, you can concatenate them before calling (use a separator like and split them inside the workflows. This is possible only if the datatype is string or number. You cannot do this for datatypes like array or dictionaryâŚ
E.g.
//Before you invoke the workflow
String arg1, arg2, arg3, arg;
arg = arg1 + â;â + arg2 + â;â + arg3;
//pass arg to the worklfow
//Inside the workflow, you should know the exact no of argments
String arrArg = arg.split(â;â);
String arg1, arg2, arg3;
arg1 = arrArg[0];
arg2 = arrArg[1];
arg3 = arrArg[2];
Note - the above one is just a logic, not the exact syntax
Thank you Skini76 for your prompt response.
But bit confused.
Could you please explain me by taking one example, having Three arguments each in 2 XAML files and those files are called in main dynamically. This would be great help from you. I really stuck at this point.
In real time scenario, I need to read the set of Functions from excel sheet and execute from REFramework. Basically we are using Testing purpose.
You said âhaving Three arguments each in 2 XAML filesâ, the no of arguments are same, then whatâs the problem ? Can you share your workflow and tell me what exactly the problem you are facing ?
Hi Skini76,
Thank you for your response. it is my bad that may be I have uploaded Developing Folder. How ever I have got solution, here I am attaching working folder. May be it will useful who browses this thread.
Note: After download,Only need to change the paths.NotePadActivity.zip (3.3 MB)
Hi,
If your arguments are of primitive data types (str, int, bool etc.) then you could pass them using JObject argument type. I am successfully using this approach.
Alternatively you could use Dictionary(string,object) - like the Config âglobal variableâ in REFramework.