Running Process Portion of Framework

workflow
invoke

#1

I am trying to run just a few workflows in the process portion of my framework. However, when I run I receive this error message

“Message: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized).”

I have received this before but I do not remember the exact cause or the best practice to fix it. I am not sure if I have to put in default values for my arguments (which are dictionaries mostly). Please help!


#2

Yes. If you need to run the Process.xaml independently then you need to add default values into your arguments!


#3

You are correct that you need to assign a value to the in arguments if you are trying to execute the process XAML on it’s own. You could also try invoking it from another workflow and passing the values that way.


#4

What would have to get passed into the default values of the dictionaries I am using as arguments?


#5

Hello. There are few thoughts I have on this.

  1. If you use the dictionary throughout your framework, then you will need to start it from the beginning even when testing specific parts. So, in your Process state, you would need to design it in a way where you can only perform certain workflows (like using a switch or just draw your arrow to certain workflows for example). Then run it from your Framework so it picks up the dictionary settings.
  2. It will be beneficial to pass dictionary values individually to workflows’ arguments rather than only the entire dictionary. That way, you can run each workflow independently by setting default values in the Arguments.

#6

What you are saying probably makes total sense. I am just somewhat new to Uipath and the framework so I guess I am not understanding the fix you are describing.


#7

Ok, let me take a simple approach.

Here is an example of something you can do in your Process portion.
Replace the Sequence inside the Try Catch with a “Flowchart” instead…
And you’ll get something like this:

Then, you can direct the process to specific invokes or sequences.

Now, you can run your framework from the beginning where it will pick up all required settings needed to perform your process portion.

I hope this is a better, easier explanation.

Regards.


#8

Is this equivalent to just commenting out the sequences I don’t want? That is what I have been doing. Its running the right processes, I’m just getting the error because of something with my dictionaries not referencing anything.


#9

The workflow arguments are OUT type. So just initializing them will not help here (my guess).

Create a test workflow Test.xaml and from there Invoke Process.xaml passing all arguments properly (In or Out). This is the way you may test the individual workflow.


#10

Ya, you are correct. You will need to find out the point right before you get the error and which variable is causing it. (like using Message Boxes to pause workflow). You can display if a variable has a value like this: (variable is nothing).tostring //should be false if it has something in it

Once you know where and which variable, then backtrack to where it gets initialized so you can figure out why it did not get initialized. Keep in mind that to pass a variable “in” an invoke, it will need to be an In argument.

That would be my suggestions.

Hope that helps.