12-04-2012 10:27 AM
Hi there. I am trying to determine if a specific variable exists in my client file from my process model.I ran across this thread that describes how to use ProperityExists(), however that only seems to work in a scobe local to the file it is being called in and I have not found a way to access outside that.
I have an objext reference to my client file already and also have a reference to MainSecuence in the client file where the local variable is if that helps..
I want the process model to take a few extra steps when running client files where this variable is defined or do nothing if it isnt.
Thanks!
Greg
12-04-2012 11:16 AM
PropertyExists(RunState.ProcessModelClient.Data.Seq["MainSequence"].Locals.Foo)
The best way to do this is to have a callback where the client will set a flag if they want to use a certain option in the process model. Similar to ReportOptions, ModelOptions and DatabaseOptions callbacks.
Hope this helps,
12-04-2012 11:23 AM
Thanks for the suggestion.. I had though I triend that one but perhaps I mis typed something or i didnt actually try it 🙂
Thanks!
12-04-2012 11:46 AM
hmmm.. So I have: Locals.Temp = PropertyExists(RunState.ProcessModelClient.Data.Seq["MainSequence"].Locals.here) Wehere Locals.Temp is a boolean. Always shows false weather the variable is there or not 😞
12-04-2012 12:37 PM
silly me.. that step was in skip mode.. hence the false reading 🙂
However,
with that line of code, I get this error:
The post-expression for the step 'Statement' could not be evaluated.
Error in argument 1, 'RunState.ProcessModelClient.Data.Seq["MainSequence"].Locals.here', in call to the expression function 'PropertyExists'.
Expected String, found Boolean.
😞
12-04-2012 04:39 PM
PropertyExists("RunState.ProcessModelClient.Data.Seq[\"MainSequence\"].Locals.Foo")
12-04-2012 04:41 PM
BTW-
If you want to test out what will and won't be there during execution you can put a breakpoint in the process model somewhere and then just type expressions in the watch pane.
It's pretty slick so you don't have to sit there and run it a million times.
12-05-2012 10:27 AM
I had not realized you could use the watch pane with expressions in that manor.. I'll have to try that, thanks for the tip!