Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hello,
I am having some problems with the auto evaluation of my expressions.
One is working fine, evaluating automatically (with no event trigger).
But the other one is not evaluating.
They are pretty much the same expression, however one of them have some input bound:
Both have these settings:
The code is just some logging (have tested with using event trigger and they both work, logging to console as they are supposed to.
Code:
Working expression:
Not working expression:
Am I missing something with the functionality of the expression function?
Anyone else that have had similar issues?
I have tried this on 9.1 and 9.3, both seem to behave in the same way.
Solved! Go to Solution.
Hello,
I found why this is happening so I thought I'd share it incase someone else wonders about the same thing.
On PTC's Help Center there is some documentation regarding the Expression function: link
The important part for this is:
• Auto Evaluate—Evaluates the expressions automatically when input parameter data is changed.
My understanding is that this means that the expression function can be triggered by the data changed event of its inputs.
Thanks,
Jens
Hello,
I found why this is happening so I thought I'd share it incase someone else wonders about the same thing.
On PTC's Help Center there is some documentation regarding the Expression function: link
The important part for this is:
• Auto Evaluate—Evaluates the expressions automatically when input parameter data is changed.
My understanding is that this means that the expression function can be triggered by the data changed event of its inputs.
Thanks,
Jens
ALWAYS - Expression executed every time regardless of data change
VALUE - Only at any Input data change
Hello,
I just tested it in a fresh 9.1 mashup (attached if you want to test it out) and it doesn't work.
You will find two expressions, Expression1 and Expression2:
Both have the same consol.log in them, one has data change type set to always while the other one has it set to value:
And as I said, neither works.
I added a button to make sure they work as well.
So if you can spot something I did wrong I'd be very happy!
Thanks,
Jens
Thanks for the Thingworx entities.
I believe is based on the input data. I'm seeing no inputs created in both the expressions.
Hello,
Yeah, so the only way to trigger it is if there is some data input, or by the event trigger.
I'm not sure why, but I had the imagination that if I had the Auto Evaluate active, it would get triggered by any load event.
I'll just trigger it by the mashup load event and it will work fine.
Thanks for your input!
Jens