Announcement

Collapse
No announcement yet.

variables in email template control structures

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • variables in email template control structures

    When I use email template (for BPMN send message task) I'm able to reslve variable values using syntax
    Code:
    {$$variableName}​
    but I don't get these variables to work in control structures like if or each. I tried:
    Code:
    {{#ifEqual needChanges 1}}
    {{#ifEqual $$needChanges 1}}
    {{#ifEqual [{$$needChanges}] 1}}
    ​
    using
    Code:
    {{#ifEqual {$$needChanges} 1}}
    throws:
    Code:
    Wrong variable naming as '{$$needChanges}' in {{#ifEqual {$$needChanges} 1}} ! You should wrap ! " # % & ' * + , ; < = > { | } ~ into [ ]
    with no luck. What is the correct syntax to access a variable in a template control expression?

  • #2
    As far as i know, there is no such support for variables. Condition could be applied only to entity's attributes. Maybe a feature request.

    Comment


    • #3
      That's a pitty. I'm looking for a way to send emails with the outcome of an multi instance user task which is stored as object in the process' variables.
      I created a simple array variable containing the strings I want to list in the email template but in the email template I cannot access these variables in the control structure since they seem not to be passed as input object like the parent entity.

      yuri Maybe you have an idea? Is it worth to create an enhancement request to e.g. put the process' variables as an object to the template context when executing an email message task?

      The quick & dirty work around I use for now is to convert the array into a string as html snippet in a separate script task, which I then add as {{$$variable}} in the email template

      Comment


      • #4
        I'll look into when get a chance. But no guarantees, as these are in separate products, it may be not that trivial to implement.

        Comment

        Working...
        X