Menu

FLOW

This library provides commands that control or otherwise affect the currently running Flow. The commands next and composeContent are seen often as they are basically essential in most Flows.  

composeContent

Evaluates the commands in the body content of the currently active document or an external document. A Flow does not automatically evaluate commands in the template's body content, so this command must be used in order to produce dynamic document content.

The template attribute defines the document content to evaluate. There are three types of valid values for this attribute:

  • An undefined value can be used in Office templates. It causes the content of the template itself to be evaluated. Note that running this command more than once in this way is not recommended, as after the first run the command attempts to evaluate the already evaluated content, which generally does nothing.            
  • A String value can be used in Online templates. The value should be a path pointing to a HTML document within the template's archive - this is the document whose content is evaluated. For example: "Document/content.html"
  • A File value can be used in both Office templates and Online templates. The file may be an Office or a HTML template, whose content is then evaluated. 

The result of the evaluation will be a File value. The name of the file in the case of Online templates' HTML documents will be the title of the document, or the name of the document part if the document lacks a title. For Office templates the name will simply be the name of the template file, or one set through the document command.    

Child Commands

  • evaluateTag
    Optional. Add one or more of these to limit the commands that are evaluated. 

Attributes

var

Required
Value type
EL-evaluated
No String
No
Defines the name of the variable placed into the variable context whose value is the evaluated document, which is a File - either an OOXML document or a HTML document depending on what the evaluated template is.

This attribute does not need to be defined if this command is evaluated in an Office template and the template attribute is undefined.
template

Required Value type EL-evaluated
No
File, String
Yes
Defines the template whose body content is evaluated. The resolved value may be either a String or a File, as described in this command's documentation.

This attribute does not need to be defined if this command is evaluated in an Office template.
importResult

Required
Value type
EL-evaluated
No
Boolean
Yes
This attribute can be used to control what a content HTML logic attribute produces when the Online template this command is in is imported through it. If this attribute's value resolves into true, then the product of this command will appear instead of the product of some other composeContent command in the same Flow.

This attribute has no effect when used in Office templates.
editable

Required
Value type
EL-evaluated
No
Boolean
Yes
If this attribute resolves into false, any commands in evaluated HTML content that can make their contents editable will not do so, regardless of their own attribute values.  

This attribute has no effect when used in Office templates.

Examples

The composeContent command is a fairly common sight in Flows and often used in this basic way to produce composed document content.

<composeContent var="composed" template="Document/content.html">

Should you have a need to produce multiple versions of your document within the Flow, it can be done without much complications by using composeContent several times while switching the data rendered in the document between the composings. This does not, however, work with Office templates unless the content to compose is an external File.

Producing a set of composed documents with a loop of record IDs:

<setCollection var="composedDocs">
<forEach value="${productIDs}" var="productID">
  <record var="product" type="Product2" recordID="${productID}" fields="Name, ProductCode">
  <composeContent var="composed" template="Document/productSheet.html">
  <addItem value="${composed}" collection="${composedDocs}">

If this Flow is part of a template that exists to provide content to import into another template's body with the HTML logic attribute content, the importResult attribute can be useful. If this Flow has multiple result documents produced by composeContent, only one of them can be imported and this attribute defines which. Just ensure its value resolves to a Boolean true for the result you wish to import.

<composeContent var="notImported" template="Document/content.html" importResult="${false}">
<composeContent var="imported" template="Document/content.html" importResult="${true}">  
evaluateTag

A child command of composeContent that defines by title or name what commands are to be evaluated during the composing process. If no evaluateTag commands are defined then all commands in the document are evaluated (default composing behavior).

The name of this command actually refers to commands, which were earlier known as "tags". While the proper name should therefore be "evaluateCommand", the name remained as is for compatibility reasons.

Parent commands

  • composeContent
    Required. The composing process initated by this parent command is affected by the limitations.

Attributes

title

Required
Value type
EL-evaluated
No
String Yes
Specifies that all commands whose title attribute has this resolved value are evaluated. Note that all commands do not have this attribute and therefore cannot be specified in this way.
type

Required
Value type
EL-evaluated
No
String Yes
Specifies that all commands with this name are evaluated. For example, to specify this command itself, the resolved value should be "evaluateTag".
next

Directs the currently active Segment to start evaluating another Step. This command interrupts the evaluation of the current Step, causing any following commands within the Step to not be evaluated.

Attributes

step

Required
Value type
EL-evaluated
Yes String Yes
Defines the Step whose evaluation is to start. The resolved value of this attribute should be the ID of a Step within the currently active Segment. If a Step with this ID does not exist or exists within another Segment, the active Segment ends immediately.

Examples

The next command can be placed within any command hierarchies, such as conditional structures. Use conditions to define differing routes for the Flow.

<if test="${skipQuestions}">
  <next step="compose">
<next step="questions">

Note that next always finishes the current Step, so in the above example the second next doesn't need to be wrapped with an inverse condition.

Another way to create multiple ways out of a Step is to use an EL expression for the step attribute. The previous example could also be done in this way.

<set var="nextStep" value="questions">
<if test="${skipQuestions}">
  <set var="nextStep" value="compose">
<next step="${nextStep}">
readInputs

Evaluates all commands in a template's content in input mode, which causes only commands in the content that provide input to do anything. The DOCX bind and HTML bind for example are such commands.  

If used in an Office template, the doc attribute should be left undefined to read input commands in the template itself. On the other hand, if used in an Online template, the doc attribute should be defined to provide the HTML content with input commands to read.

Attributes

doc

Required
Value type
EL-evaluated
No File Yes
This attribute can be used to define a HTML template File with input commands to read.
setEndURL

Set the URL into which the browser of the user running this Flow navigates to upon the conclusion of the Flow. If the web application running the Flow is already configured to head into a particular URL after the Flow's conclusion, this tag overrides that setting.

Note that all Flow-running web applications may not support this setting, in which case this tag does nothing.

Attributes

value

Required
Value type
EL-evaluated
Yes String Yes
The resolved value of this attribute should be the target URL in string form.
setFollower

Sets another Flow to be a follower for the currently active Flow.  Once the current Flow finishes, the follower will start immediately and the UI showing the Flow's progress should seamlessly switch to observing the follower. The variable context is, by default, not carried over to  the follower, but a Map of external parameters can be defined to carry over a set of values even if the context is refreshed between the Flows.            

Do note that this commands only "configures" what will happen once the current Flow finishes, therefore not having any immediate effect at the time it is executed. Any Flow step or Screen step will clear this follower setting, though, so this command should be placed between the end of the Flow and the last Flow step or Screen step. Also note that a Flow can have only one follower defined for it, so any setFollower past the first will just overwrite what the previous one defined.

Attributes

resourceProvider

Required
Value type
EL-evaluated
No File Yes
The resolved value of this attribute is expected to a be a Dynamo template file that contains the Flow specified with flowID and any resources, such as Screens, that Flow needs.

If not defined, the currently active template will be used as this resource provider.
flowID

Required
Value type
EL-evaluated
Yes String Yes
Defines the ID of the Flow to be run as the follower.
event

Required
Value type
EL-evaluated
No String Yes
Defines an event ID that is given to the follower Flow.

If not defined, the given event ID will be an empty string.
preserveContext

Required
Value type
EL-evaluated
No Boolean Yes
Defines if the currently running Flow's variable context is carried over to the follower Flow.
If not defined, the default value of false is used, meaning that only variables defined with the params attribute move to the follower Flow.
params

Required
Value type
EL-evaluated
No Map Yes
Defines a Map that will be delivered as external parameters to the follower Flow. The resolved value of this attribute is therefore expected to a be a Map. As other external parameters, this Map can be accessed in the follower Flow with the variable "param".
If not defined, the currently active Flow's external parameters are delivered to the follower Flow.
setMessage

Changes the message of the Step that is currently being evaluated.

Attributes

message

Required
Value type
EL-evaluated
No String Yes
The resolved value of this attribute is set as the Step's new message.
If not defined, the message will be a blank string.

Examples

Unlike the messages written into the Steps themselves, the setMessage command can set messages including variable values since its message attribute is EL-evaluated.

Greet the user running the Flow:

<setMessage message="Hello ${UserInfo.fullName}">

Provide information of loop progress:

<forEach value="${longCollection}" var="item" varStatus="status">
  <setMessage message="Processing item ${status.count} of ${longCollection.size()}">

Comments

0 comments