Different Control Flows

gravatar

cell

This snippet demonstrates three examples of package control flow.

published 09.07.12

last updated 09.09.12


Share

                            


<Biml xmlns="http://schemas.varigence.com/biml.xsd">
	<Packages>
		<Package Name="Control Flow Sample 1" AutoCreateConfigurationsType="None" ConstraintMode="Linear">
			<Tasks>
				<Dataflow Name="Task 1"/>
				<Dataflow Name="Task 2"/>
				<Dataflow Name="Task 3"/>
			</Tasks>
		</Package>
		<Package Name="Control Flow Sample 2" AutoCreateConfigurationsType="None" ConstraintMode="Parallel">
			<Tasks>
				<Dataflow Name="Me First"/>
				<Dataflow Name="Me Next (Success)">
					<PrecedenceConstraints>
						<Inputs>
							<Input OutputPathName="Me First.Output"/>
						</Inputs>
					</PrecedenceConstraints>
				</Dataflow>
				<Dataflow Name="I'm Last (Always)">
					<PrecedenceConstraints LogicalType="Or">
						<Inputs>
							<Input OutputPathName="Me First.Output" EvaluationValue="Failure"/>
							<Input OutputPathName="Me Next (Success).Output" EvaluationValue="Completion"/>
						</Inputs>
					</PrecedenceConstraints>
				</Dataflow>
			</Tasks>
		</Package>
		<Package Name="Control Flow Sample 3" AutoCreateConfigurationsType="None" ConstraintMode="Parallel">
			<Variables>
				<Variable Name="Continue" DataType="Int32">0</Variable>
			</Variables>
			<Tasks>
				<Dataflow Name="Task 1"/>
				<Dataflow Name="Task 2">
					<PrecedenceConstraints>
						<Inputs>
							<Input OutputPathName="Task 1.Output" EvaluationOperation="Expression" Expression="@Continue==1"/>
						</Inputs>
					</PrecedenceConstraints>
				</Dataflow>
			</Tasks>
		</Package>
	</Packages>
</Biml>
                        

This Biml snippet creates three packages, each demonstrating a different control flow option in Biml. The first package contains three Dataflow tasks. No precendence constraints are present since the package's ConstraintMode is set to linear. A linear ConstraintMode instructs the Biml compiler to make the package's task run sequentially.

The second package has its ConstraintMode set to parallel, which requires task ordering to be specified via precedence constraints. The second Dataflow task's precedence constraint indicates that it runs only if the first task evaluates to success. Despite the Input task not having its EvaluationValue attribute explicitly set, success is the default value. The third Dataflow task has two precedence constraints, evaluated with a Or condition, as specified by the LogicalType attribute. Thus, the third task will run if either constraint is satisfied.

The third package demonstrates using a precedence constraint with an evaluation operation, rather than a defined evaluation value.

You are not authorized to comment. A verification email has been sent to your email address. Please verify your account.

Comments

There are no comments yet.