<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/tg/onlinemanual/000037" xml:lang="en">
	<Header>
		<Title xmlns:ssa="http://www.ssaglobal.com" xmlns:HTML="http://www.w3.org/TR/REC-html40">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 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><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"><TBODY><TR><TD>&lt;=</TD>
							<TD>(smaller or equal)</TD>
						</TR>
						<TR><TD>&lt;</TD>
							<TD>(smaller)</TD>
						</TR>
						<TR><TD>=</TD>
							<TD>(equal)</TD>
						</TR>
						<TR><TD>&gt;</TD>
							<TD>(larger)</TD>
						</TR>
						<TR><TD>&gt;=</TD>
							<TD>(larger or equal)</TD>
						</TR>
						<TR><TD>&lt;&gt;</TD>
							<TD>(unequal)</TD>
						</TR>
					</TBODY>
				</TABLE>
			</GeneralSection>
			<GeneralSection><SectionTitle>Boolean Operands:</SectionTitle>
				<TABLE border="1"><TBODY><TR><TD>AND</TD>
							<TD>(all must be true for the outcome to be true)</TD>
						</TR>
						<TR><TD>OR</TD>
							<TD>(at least one must be true for the outcome to be true)</TD>
						</TR>
						<TR><TD>XOR</TD>
							<TD>(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>
		</GeneralSection>
		<ExampleSection ID="C"><SectionTitle>Examples of dynamic conditions</SectionTitle>
			<List><ListItem><Code>$OrderTotal &gt; 1000</Code>: The workflow attribute's value OrderTotal must be greater than 1000.</ListItem>
				<ListItem><Code>$Status = "Ready": The workflow attribute's value Status must be equal to Ready.</Code>
				</ListItem>
				<ListItem><Code>$Payed = True</Code>: The workflow attribute's value Payed must be set to True.</ListItem>
				<ListItem><Code>($OrderTotal &gt; 1000) AND ($OrderAmount &gt; 100)</Code>: The workflow attribute's value OrderTotal must be greater than 1000 and the workflow attribute's value OrderAmount must be greater than 100.</ListItem>
			</List>
		</ExampleSection>
	</GeneralSection>
</ManualTopic>
