Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 16:42 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: March 2010
Junior Member
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 07:20 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
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: Tue Apr 23 14:11:19 GMT 2024

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

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

Back to the top