Fire up your applications with Jetfire
RSS
Jetfire Wiki

About Us

Code Plex Projects

COR COR Administration Debug GUI Jetfire Administration Jetfire Code Jetfire Core Jetfire Language Jetfire Web Part Library misc Release Notes Roles Solutions States Training User Administration Versioning Web Parts Web Service Website Design Website Procedures Wiki conventions WordML Workflow Administration

Quick Search
»
Advanced Search »

PoweredBy

Templates

The templating feature of Jetfire supports the dynamic creation of code. This feature is significantly more advanced and easier to use than C# generics or C++ templates.

Jetfire templating is totally generic. It can be used to generate Jetfire code or any other text based source code (eg HTML, JavaScript, C#, etc).


Template Method Rules

  • Template instructions may only be placed in a 'Template' method.
  • A Template method is defined as follows:
    • Has return type of string.
    • Returns the variable 'value'.
    • Contains 1 or more template instructions.
    • The method may have parameters.
  • A Template instruction is a source code line that begins with '##' or '#+#'.
    • Use '##' to generate a template line with a new line string at the end of the line.
    • Use '#+#' to generate a template line with no new line string.
    • The 'Template' source line must be terminated by a new line character.
  • Any Jetfire variable may be placed in a Template instruction bracketed by dollar signs ('$').
    • Jetfire variables will be resolved to strings when the Template method is executed.

Template Example

                namespace JetfireApps
                {
                 public workflow MyFlow
                 {
                    ArrayList list = new ArrayList();
                    public MyFlow()
                    {
                       list.Add(""One"");
                       list.Add(""Two"");
                       list.Add(""Three"");
                    }
                    public string TemplateTest()
                    {
                        ## the first line
                        foreach (string s in list)
                        {
                            ## $s$
                        }
                        return value;
                    } 
                 }
The 'Template' method 'TemplateTest()' when executed will return a string with the following value:
 the first line
 One
 Two
 Three

See Also

First Class Constructs
Jetfire Overview

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.