04-06-2011 02:27 PM
Hi,
I created a step which calls a module (.dll). This step creates an object and stores its reference into a local variable called "ObjectRef".
Here's what i did:
1. insert step->action: "Action"
2. specify module
3. filled the assembly text box
4. selected the right class
5. filled the .NET invocation text box
6. specified the Value text box to : "Locals.ObjectRef"
Then, I created another step in order to call the method "getValue" from the object created earlier
Here's what I did:
1. insert step->action: "Action2"
2. specify module
3. filled the assembly text box
4. selected the right class
5. filled the .NET invocation text box with "Use existing object(ClassLibrary.cls604242_00).getValue()"
6. Specified the Value text box : "Locals.returnValue"
At run-time, I would expect to see the value of "returnValue" in the variable panel but I don't. Moreover I'm getting a run-time error message.
Could anyone indicate me what I'm doing wrong?
As I mentionned in the subject, I'm conducting an evaluation of this product for my company.
Thanks
Mathieu BAzinet
Solved! Go to Solution.
04-06-2011 02:40 PM
Hi acheo,
On your second step, you need to specify your local object reference to be the existing object that should be used to make the call on. If you click on the "Use Existing" part of the .NET Invocation text, the parameters grid will display the parameters for that call (instead of your second call which is shown in your screenshot), which will just be one parameter that specifies the object reference to use.
Also note that you could even add a second call to your first .NET step by typing a '.' after your call to get the "Instance" property and you could call "getValue" directly from there. The key thing to remember is that the parameters grid only shows parameters for one call at a time, that being the currently selected call which is shown in bold in the Invocation text box.
-Jeff
04-06-2011 04:15 PM
Hi Jeff,
If I add a '.' after the call to get the instance in "Action" (first step), yes it works as youu suggested in your second paragraph.
However I don't quite understand the way you do it as explained in your first paragraph. What should I add or get rid off in the .Net Invocation for the second step (Action2)?
thanks!
Mathieu
04-06-2011 04:24 PM
Yeah my first explanation wasn't very clear, sorry. You can do the following to correct your second step:
1) Click anywhere on the text that reads "Use Existing Object(ClassLibrary.cls604242_000)" in the .NET Invocation control. This will "select" that call and will cause the parameters grid below it to show the parameters for that call.
2) You will then see one parameter listed in the grid, with a name of "Existing Object". In the Value column for that row, you should fill in the local variable where your object is stored (Locals.ObjectRef).
Basically, you had told the step to use an existing object reference, but you never specified what object reference to use.
Another tip is that if you have an error in one of your calls on your step, it will show the text in red in the .NET Invocation control. So if you haven't specified a required parameter, it will show that parameter in red in the invocation control. In this instance there was an error with the single parameter on the Use Existing Object call, and you can see in your screenshot that the parameter is displayed in red text.
Hope that helps.
-Jeff
04-07-2011 11:14 AM
Hi Jeff,
No luck!
The image I sent you does depict red stuff but here, with getValue selected in the .NET Invocation, there is no error. I also used the check expression for error button and it passed the test.
Bascially, I want to store the value returned by the existing object in my local variable returnValue. In C# it would look like:
returnValue = ObjectRef.getValue();
Any suggestion?
matt
04-07-2011 11:20 AM
Hi Matt,
Can you attach a screenshot of your step when you have "Use Existing Object" as the selected call? You need to make sure that call also does not contain an error, because if it does, the next call ("getValue") will not be able to execute. Like I said before, judging from the red text in that call, you do not have that call's parameters specified properly.
-Jeff
04-07-2011 11:35 AM
Jeff,
Here's the screen shot.
Matt
04-07-2011 11:56 AM
Hi Matt,
I think you misunderstood me. Could you please click on "Use Existing Object" in the Invocation control so that it becomes the selected call and then post a screenshot of the step?
-Jeff
04-07-2011 12:00 PM
Sorry..here's the screenshot.
matt
04-07-2011 12:03 PM
Hi Matt,
Like I mentioned before, you need to specify the object reference that the step should use. This means that in the Value cell for the "Use Existing Object" call you need to put "Locals.ObjectRef" since that is where your first step stored the reference.
-Jeff