Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » Assert Statement in Jet?(How to stop Jet transformation with error)
Assert Statement in Jet? [message #520512] Fri, 12 March 2010 11:42 Go to next message
Eclipse UserFriend
I'm using an xml file as an input. I need to error check a version number that comes from the xml file against the version number of the template file before I allow the code generation to continue. In other non-Jet based projects, we use an ASSERT statement that prints a description of the error.

Does Jet support something like assert or is there something better I should use?

Thanks
Re: Assert Statement in Jet? [message #522332 is a reply to message #520512] Mon, 22 March 2010 03:20 Go to previous message
Eclipse UserFriend
Debbie:

This is no assert, but if you are looking to issue an error message, and
prevent further execution, I suggest using a combination of the c:log
tag and a c:if...

.... initialize variable, assuming no errors ...
<c:setVariable var="errorFound" select="false()"/>

.... do error checking ...

... when error is found ...
<c:setVariabler var="errorFound" select="true()"/>
... issue a message ...
<c:log severity="error">Your error message here...</c:log>

<c:if test="not(errorFound)">
... do the real work ....
</c:if>


The error message gets written to the execution console. Or, if you are
running the JET transformation via API, it is included in the IStatus
returned by the JET2Platform.runTransformOnXXX() methods. Either way,
you should be able to make the message visible to your users.

Paul
Previous Topic:[Xpand] Encoding problem while debugging
Next Topic:[JET] Implicit objects 'context' and 'out'
Goto Forum:
  


Current Time: Wed Jul 30 13:13:20 EDT 2025

Powered by FUDForum. Page generated in 0.03501 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top