Skip to main content
Jump to: navigation, search

Difference between revisions of "Tigerstripe FAQ"

(How do I Access Stereotype Values From a Template?)
Line 56: Line 56:
==What is in the Default Velocity Context?==
When you run a template based rule, the Velocity context is pre-loaded with a whole set of collections and other useful items. The full list of the items loaded can be found in the [[Tigerstripe Plugin Miscellany]] tutorial.

Revision as of 08:56, 3 June 2008

< To: Tigerstripe

Tigerstripe Overview

Tigerstripe Workbench provides an integrated Model-Driven Engineering framework allowing users to create/edit/maintain models across large teams, configure transformations to code, documentation or specifications and integrate it in a continuous build environment.

What is the relationship with Tigerstripe Software?

This is the open-source incarnation of Tigerstripe Workbench as it was distributed by ex-Tigerstripe Software. In January'07 the source code for Tigerstripe was cleaned up and contributed to the Tigerstripe Eclipse Project as a sub-project of the Eclipse Technology Project.

What's up with version numbers?

The last non-open source version of Tigerstripe Workbench was released as v2.2.4 on This was a stop gap release for existing users of Tigerstripe until the first open-source releases were made available. Additionally, following Eclipse Guidelines, Tigerstripe release numbering needs to comply with Eclipse rules. In particular, during the incubation period only 0.xx versions can be released.

So, although the contributed code remains the same, the first open-source build (Incubation 0.3) corresponds to a bugfix release for the last non-open release (v2.2.4).

OSS/J Support with Tigerstripe

Tigerstripe has been used since 2006 to produce OSSJ APIs. Since 0.3, the support for OSSJ in Tigerstripe Workbench has changed. For more details visit the Tigerstripe_OSSJ page.

How do I Access Stereotype Values From a Template?

Most model components support accessing Stereotypes, but the method of access is the same for all types. (See also method return Stereotypes)

The following example will generate an XML snippet for all of the stereotypes on "$component" which must be an IStereotypeCapable. It first checks for teh existence of *any* stereotype instances, then iterates over each instance. The CharacterizingStereotype is used to look up the *defined* attributes (ie in the profile) for this particular stereotype, and then we examine the attribute values - checking for array type attributes.

Note that not all of these steps will be applicable/required in all cases - for example you may not need the isEnpty() step at the start if there is no "wrapper" element required. Note also that the value of any StereotypeAttribute will be a String - in the case of a boolean Attribute type the values will be limited to "true" or "false".

 ## Check if there are *any* stereotype instance on $component
   ## Iterate over each instance
   #foreach ($instance in $component.StereotypeInstances)
                  <ts:stereotype name="$instance.Name">
     ## Check the defined attributes for this instance (note that these might not have any value for a given instance)
     #foreach ($attribute in $instance.CharacterizingStereotype.Attributes)
                     <ts:stereotypeAttribute name="$attribute.Name" array="$attribute.Array">
       ## Handle array types if necessary
       #if($attribute.Array == "false")
         #foreach ($val in $instance.getAttributeValues($attribute))

How do I Access Stereotype Values on a method Return?

The logic is exactly the same as for stereotypes on other model components, but the stereotype instances are obtained using the method :


What is in the Default Velocity Context?

When you run a template based rule, the Velocity context is pre-loaded with a whole set of collections and other useful items. The full list of the items loaded can be found in the Tigerstripe Plugin Miscellany tutorial.

Back to the top