<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tg/onlinemanual/000037" xml:lang="en">
   <Header>
      <Title>Dynamic conditions</Title>
   </Header>
   <GeneralSection>
      <Paragraph>A dynamic condition is an
		expression that determines the direction in which a business process is
		continued. A dynamic condition is linked to an outgoing relationship that
		follows a control activity in a business process. Applying a dynamic condition
		results in the activation or deactivation of parts of a business process.
		Whether a dynamic condition is applicable is determined during the execution of
		a business process by the Workflow Management System.</Paragraph>
      <List>
         <ListItem> 
            <Link href="#A" role="internal">General</Link>
         </ListItem>
         <ListItem> 
            <Link href="#B" role="internal">Syntax of a dynamic condition</Link>
         </ListItem>
         <ListItem> 
            <Link href="#C" role="internal">Examples of dynamic conditions</Link>
         </ListItem>
      </List>
   </GeneralSection>
   <GeneralSection ID="A">
      <SectionTitle>General</SectionTitle>
      <Paragraph>The following general
		rules apply to a dynamic condition:</Paragraph>
      <List>
         <ListItem>The expressions are not case sensitive.</ListItem>
         <ListItem>Dynamic conditions can only be linked to an outgoing
		  relationship that is leaving a control activity that is of type XOR or OR.</ListItem>
         <ListItem>If the dynamic condition that is linked to an outgoing
		  relationship is not defined, the result is always true.</ListItem>
         <ListItem>A workflow attribute must always be preceded by a dollar sign $
		  for use in a dynamic condition.</ListItem>
      </List>
      <Note>
         <SectionTitle>Note</SectionTitle>
         <Paragraph>You can add a comment
		  between a (|) and the end of the line.</Paragraph>
         <Paragraph>You can zoom to
		  business process attributes in the text editor to include an attribute in the
		  dynamic condition.</Paragraph>
      </Note>
   </GeneralSection>
   <GeneralSection ID="B">
      <SectionTitle>Syntax of a dynamic condition</SectionTitle>
      <Paragraph>An expression build following the syntax rules can be used as a
		dynamic condition.</Paragraph>
      <Paragraph>The syntax rules are divided into five main categories namely:
		constants, logical operands, boolean operands, terms and expressions. The first
		three are very straight forward their options are listed. The category terms
		can be a constant (an option from the category constants), a workflow attribute
		or a formula that uses a logical operand from the category logical operands.
		The workflow attribute can be used to retrieve the value in a field of an ERP
		session. This way you can, based on the field's value, make a decision. An
		expression can be a term but an expression can also be used to create a formula
		with the help of boolean operands.</Paragraph>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Constants</SectionTitle>
      <Paragraph>Boolean constant (True or False)</Paragraph>
      <Paragraph>Enumerate constant (Domain.Constant Name) For example,
		tgbrg.actp.manual for "Manual Activity"</Paragraph>
      <Paragraph>Numeric constant (Number). For example, 123</Paragraph>
      <Paragraph>Double constant (Number with decimals). For example,
		123.12</Paragraph>
      <Paragraph>String constant (String). For example, "business as usual"</Paragraph>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Logical Operands:</SectionTitle>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="6">
            <TR no="1" isLast="false">
               <TD rowspan="1" colspan="1">&lt;=</TD>
               <TD rowspan="1" colspan="1">(smaller or
				equal)</TD>
            </TR>
            <TR no="2" isLast="false">
               <TD rowspan="1" colspan="1">&lt;</TD>
               <TD rowspan="1" colspan="1">(smaller)</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD rowspan="1" colspan="1">=</TD>
               <TD rowspan="1" colspan="1">(equal)</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD rowspan="1" colspan="1">&gt;</TD>
               <TD rowspan="1" colspan="1">(larger)</TD>
            </TR>
            <TR no="5" isLast="false">
               <TD rowspan="1" colspan="1">&gt;=</TD>
               <TD rowspan="1" colspan="1">(larger or
				equal)</TD>
            </TR>
            <TR no="6" isLast="true">
               <TD rowspan="1" colspan="1">&lt;&gt;</TD>
               <TD rowspan="1" colspan="1">(unequal)</TD>
            </TR>
         </TBODY>
      </TABLE>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Boolean Operands:</SectionTitle>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="3">
            <TR no="1" isLast="false">
               <TD rowspan="1" colspan="1">AND</TD>
               <TD rowspan="1" colspan="1">(all must be true for the
				outcome to be true)</TD>
            </TR>
            <TR no="2" isLast="false">
               <TD rowspan="1" colspan="1">OR</TD>
               <TD rowspan="1" colspan="1">(at least one must be true for
				the outcome to be true)</TD>
            </TR>
            <TR no="3" isLast="true">
               <TD rowspan="1" colspan="1">XOR</TD>
               <TD rowspan="1" colspan="1">(at most one must be true
				for the outcome to be true)</TD>
            </TR>
         </TBODY>
      </TABLE>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Terms:</SectionTitle>
      <Paragraph>Constant $Workflow attribute term <Emphasis>Logical
		Operand</Emphasis> Term</Paragraph>
      <Note>
         <SectionTitle>Note</SectionTitle>
         <Paragraph>Do not add a space between the $ sign and the workflow
		  attribute name!</Paragraph>
      </Note>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Expressions:</SectionTitle>
      <Paragraph>NOT (Expression) (Expression) (Expression) <Emphasis>Boolean
		Operand</Emphasis> (Expression)</Paragraph>
   </GeneralSection>
   <ExampleSection ID="C">
      <SectionTitle>Examples of dynamic conditions</SectionTitle>
      <Formula space-and-orientation="indented-estimated">
         <Paragraph>$OrderTotal &gt; 1000</Paragraph>
      </Formula>
      <Paragraph>The workflow attribute's value OrderTotal must be greater than
		1000.</Paragraph>
      <Formula space-and-orientation="indented-estimated">
         <Paragraph>$Status = "Ready"</Paragraph>
      </Formula>
      <Paragraph>The workflow attribute's value Status must be equal to
		Ready.</Paragraph>
      <Formula space-and-orientation="indented-estimated">
         <Paragraph>$Payed = True</Paragraph>
      </Formula>
      <Paragraph>The workflow attribute's value Payed must be set to
		True.</Paragraph>
      <Formula space-and-orientation="indented-estimated">
         <Paragraph>($OrderTotal &gt; 1000) AND ($OrderAmount &gt; 100)</Paragraph>
      </Formula>
      <Paragraph>The workflow attribute's value OrderTotal must be greater than
		1000 and the workflow attribute's value OrderAmount must be greater than 100.</Paragraph>
   </ExampleSection>
</ManualTopic>