Skip to main content


Perform activities repeatedly as long as a condition is true.


<while condition='context.IsApproved="1"'>


Attribute or Element Description Value
condition attribute Required. This expression is evaluated before each pass through the activities in the <while> element. Once false, it stops execution of the <while> element. An expression that evaluates to the integer value 1 (if true) or 0 (if false). This expression must use the scripting language specified by the containing <process> element.
name, disabled, xpos, ypos, xend, yend attributes See “Common Attributes and Elements.”  
<annotation> element
Other elements Optional. <while> may contain zero or more of the following elements in any combination: <alert>, <assign>, <branch>, <break>, <call>, <code>, <continue>, <delay>, <empty>, <flow>, <foreach>, <if>, <label>, <milestone>, <reply>, <rule>, <scope>, <sequence>, <sql>, <switch>, <sync>, <throw>, <trace>, <transform>, <until>, <while>, <xpath>, or <xslt>.  


The <while> element defines a sequence of activities that are repeatedly executed as long as a logical expression evaluates to the integer value 1 (true). The expression is re-evaluated before each loop through the sequence.

You can fine-tune loop execution by including <break> and <continue> elements within a <while> element. For example:

<while condition="0">

  // various things...

  <if condition="somecondition">

  // various other things...

FeedbackOpens in a new tab