cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Trigger: abortScript() boolean parameter senseless?

JensN.
13-Aquamarine

Trigger: abortScript() boolean parameter senseless?

Hi @all,

for the abortScript()-function in the ScirptEnvironmentBean you can give two parameters: "msg", the message which will pop at the user client and "veto", a boolean. If veto is set to true the actual trigger-operation will be cancelled. If veto is set to false the operation doesnt stop. So far so good. But if veto is set to false the msg will also not popup at the user client. Why? And for which reason i need a boolean if it has only one function and the other setting is meaningless?

kind regards, Jens

2 REPLIES 2
KaelLizak
14-Alexandrite
(To:JensN.)

Hello Jens,

From the JavaDoc for abortScript(...) (underline is mine):

Exits the script and optionally aborts the transaction. Abort the transaction via this method when the end user has made an error. If the error is due to a bad configuration - that is, something the administrator or the solution can and should fix, then use badConfiguration() instead. This method does not provide details to the end user about the trigger script. We assume that the user does not need such details if the problem is in the user's data rather than in the script or configuration. This script does not write to the log. If you need to know track whether a particular error occurs often, augment your script. If veto is false then the script is exited, the transaction is allowed to proceed, no message is presented to the user or written to the log, and nothing shows up in the server log.

This always aborts the script. When the boolean value is true, it also aborts the entire transaction. The warning message is only shown if the entire transaction is aborted, because currently Integrity can only provide a message to users as a result of processing, and that only happens for sure when the boolean value is true.

If you would like to be able to display messages to users without affecting command execution flow, or without having a result of processing, please attach your organization to CS83676: How to display an information dialog from a trigger (RFC 97577).

I hope that clarifies the difference--I had to check, myself.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
JensN.
13-Aquamarine
(To:KaelLizak)

Hi Michael,

thanks for your answer (and for sure for your underline ), i didnt notice the difference between exit the script and stop the transaction. So now its much more clear for me. And also thanks for your hint to the RfC, i think we will be added to it in the next days.

kind regards, Jens

Top Tags