Flow Commands

◷ Reading Time: 13 minutes

These commands handle the logic of a flow. A flow logic may have some rule parameters defined by a Declaration command.

Common

Selection

To select a node in the flow

Note

To create a note/memo related to the flow.

Summary

  • Allows the creation of a note in the workspace.
  • Notes can be related to the flow/memo/anything that the user should know when running the process.
  • It does not require any connection/transition to any other node in the workflow.

Connections

Straight

Add a straight line to connect two nodes.

Summary

When two nodes are connected, you can create a straight line in between to connect them.

Bezier

Add a curved line to connect two nodes.

Summary

When two nodes are connected, you can create a curved line in between to connect them.

Right Angle

Add a right-angled line to connect two nodes.

Summary

When two nodes are connected, you can create a right-angled line in between to connect them.

LifeCycle

Start

Every flow must have a Start node that shows the beginning of the flow life cycle.

Summary

A flow consists of multiple steps. Every flow requires a starting point. The Start node denotes the initial step of the flow.

Transitions

  • Incoming: 0 (start node cannot have any incoming transitions)
  • Outgoing: 1 (start node can have only one transition)

Properties 

  • Info
    • Name: The name of the node in the IRD must be unique and is corresponding to a Parameter.
    • Node Type: This shows the type of node.
  • Display (Appearance)
    • Text: The text that is displayed on the node
    • Font: Style of the text on the node
    • Border: Style of the node’s border
    • FillColorFrom: Gradient starting background-color
    • FillColoeTo: Gradient ending background-color
  • Metadata
    • Description: The description of the activity node.
    • Attribute Types: This allows to associate a metadata form to the node and will extra structured metadata about the node.

Parameters

  1. name
    1. Description: Name of the node
    2. Mandatory: Yes
    3. Type: String

Example

A simple Start tool with an End tool

It is a must to have an End instance to run a Start instance.

XML API

Every flow has a start as part of its normal life cycle. This command defines the start of the flow. Every flow’s Node collection must have this command. Execution is started from this command and carries on by activating different outgoing transactions.

No transition in the flow can set this node as its target node. This node cannot have any incoming transitions.

Sample

<Start name="flowStartNode">
      <Transition name="tr0" to="pause"/>
</Start>

End

This ends the flow and is the flow execution terminator. No further action will take place after reaching this node.

Summary

Every flow’s Node collection must have this command. The engine finishes the execution upon reaching this node.

Transitions

  • Incoming: 1 (End node can have only one incoming transition)
  • Outgoing: 0 (End node cannot have any outgoing transitions)

Properties

  • Info
    • Name: The name of the node in the IRD must be unique and is corresponding to a Parameters.
    • Node Type: Shows the type of node.
  • Display (Appearance)
    • Text: The text that is displayed on the node
    • Font: Style of the text on the node
    • Border: Style of the node’s border
    • FillColorFrom: Gradient starting background-color
    • FillColoeTo: Gradient ending background-color
  • Metadata
    • Description: The description of the activity node.
    • Attribute Types: Allows to associate a metadata form to the node and will extra structured metadata about the node.

Multi end nodes in flow

The End node can accept only one incoming transition. If multiples of other nodes need to go to an End, then you can use an empty Activity node as a fork point to the End, and from this fork node, one transition goes to the End.

Parameters

  1. name
    1. Description: Name of the node
    2. Mandatory: Yes
    3. Type: String

Example

A simple End tool with a Start tool

It is required to create a Start instance to Run an End instance

XML API

Sample

<Activity name="activity1>
 <Transition name="tr1" to="flowEndNode" />
</Activity>
<End name="flowEndNode"/>

Restart

Re-runs the flow from the beginning in the same context.

Summary

The process restarts once it reaches a Restart node.

Transitions

  • Incoming: 1 (Restart node can have only one incoming transition)
  • Outgoing: 0 (Restart node cannot have any outgoing transitions)

Properties

  • Info
    • Name: The name of the node in the IRD which must be unique and is corresponding to a Parameters.
    • Node Type: Shows the type of node.
  • Display (Appearance)
    • Text: The text that is displayed on the node
    • Font: Style of the text on the node
    • Border: Style of the node’s boarder
    • FillColorFrom: Gradient starting background color
    • FillColoeTo: Gradient ending background color
  • Metadata
    • Description: The description of the activity node.
    • Attribute Types: Allows to associate a metadata form to the node and will extra structured metadata about the node.

Example

Example 1

  • If input is not 0, the value for input will keep incrementing.
  • Once the process starts to run step-by-step, the increment can be seen in the Parameter window.
  • Create an Activity to set the increment, input=input+1.
  • Create a decision to check whether input=0.

Increment of input parameter

input should be defined as a Local parameter and set its value to 1. See Variable Parameter in order to understand how to declare a variable parameter.

Terminate

This ends the flow and is the flow execution terminator. A flow might have multiple terminate nodes.

Summary

Terminates the process at any stage of the flow. No outgoing transition is allowed for this node.

Transitions

  • Incoming: 1 (Terminate node can have only one transition)
  • Outgoing: 0 (Terminate node cannot have any outgoing transitions)

Properties

  • Info
    • Name: The name of the node in the IRD which must be unique and is corresponding to a Parameters.
    • Node Type: Shows the type of node.
  • Display (Appearance)
    • Text: The text that is displayed on the node
    • Font: Style of the text on the node
    • Border: Style of the node’s border
    • FillColorFrom: Gradient starting background color
    • FillColoeTo: Gradient ending background color
  • Metadata
    • Description: The description of the activity node.
    • Attribute Types: Allows to associate a metadata form to the node and will extra structured metadata about the node.

Example

  • In this example,
    • If (input=1), terminate the process
    • If (input=0), end the process
  • Terminate is a useful tool when you want to end a process without reaching the end.

For this example, it is required to create a Decision instance.

Throw

This node in the flow will throw an exception and makes the executing flow go to a Fault state. You may use this command in the flow to terminate the flow execution for a specific reason.

Summary

This node throws an exception for a specific reason and code when the execution reaches it. This causes the running flow (process) to be set into a Fault state, thereby ending the execution. The type of exception that will be thrown is ProcessErrorException.

Properties

  • Name: Name of the node
  • Code: Any code that can be used as a reference later
  • Reason: Any reason for the throwing of the exception

Example

When the process is started, it will give an exception once it reaches the Throw node.

Properties

  • Code: 1101
  • Reason: Example reason to throw an exception

Popup window that appears once the process reaches the Throw node

XML API

Sample

<Thrown name="expcetion1" code="-1003" reason="User not identified" />

Steps

Activity

This is the actual action that will occur in a flow logic. It is the extension point of the flow rules. You can extend this node to accomplish different tasks during the flow execution. Out of the box, you can execute a Procedural rule by referring to the rule address.

Summary

An Activity node allows you to define a step in the flow and execute it as part of the flow or workflow run. The Activity can either:

  1. Be linked to a procedural logic and execute the logic
  2. Have an Expression associated and execute the expression
  3. Become a empty (null) activity that allows multiple transitions to join from multiple routes to a single step.

Transitions

  • Incoming: at least 1 incpming node
  • Outgoing: at least 1 (If there are multiple outgoing transitions defined, then each transition can set its Condition and Priority properties.)

Properties

  • Action
    • Expression: An Expression associated to the Activity that will be executed when the engine reaches it.
    • Procedure
      • Uri: When set, the Activity node will be linked to a procedural logic document by address
      • Context Mode: When the linked procedure is executed, it allows you to use the parent (flow) context or has its own context.
      • Result Copy Mode: When a linked procedure is executed, this copies the procedure’s parameters to the parent (flow) execution context based on this setting.
      • Parameters: When the context is New, it allows the flow to specify the value for the input parameters on the Procedure.
    • Handler: allows the linking of a custom handler to this node by an Assembly and Type name. The custom handler is the interface that is implemented by code to customize the Activity behaviour.
  • Info
    • Name: The name of the node in the IRD which must be unique and is corresponding to a Parameters.
    • Node Type: Shows the type of node.
  • Display (Appearance)
    • Text: The text that is displayed on the node
    • Font: Style of the text on the node
    • Border: Style of the node’s boarder
    • FillColorFrom: Gradient starting background color
    • FillColoeTo: Gradient ending background color
  • Metadata
    • Description: The description of the activity node.
    • Attribute Types: Allows to associate a metadata form to the node and will extra structured metadata about the node.

Example

  • Create an activity to calculate 1+1 and show the result by storing the value in the result variable.

Properties

  • Expression: result=1+1

result should be defined as an Out parameter. See Variable Parameter in order to understand how to declare a variable parameter.

Multi Expression

This is similar to Activity but allows the flow to evaluate multiple expressions as a group on the execution of a node.

Summary

MultiExpression node allows you to define steps in the flow and execute them as part of the flow or workflow run. It is similar to running multiple Activity nodes within one node. The MultiExpression can:

  1. Be linked to a procedural logic and execute the logic
  2. Have one or more expressions

Transitions

  • Incoming: minimum of 1 node
  • Outgoing: 1 node

Properties

  • Action
    • Expressions: Expressions associated with the MultiExpression node that will be executed when the engine reaches it.
  • Info
    • Name: The name of the node in the IRD which must be unique and is corresponding to a Parameters.
    • Node Type: Shows the type of node.
  • Display (Appearance)
    • Text: The text that is displayed on the node
    • Font: Style of the text on the node
    • Border: Style of the node’s boarder
    • FillColorFrom: Gradient starting background color
    • FillColoeTo: Gradient ending background color
  • Metadata
    • Description: The description of the activity node.
    • Attribute Types: Allows to associate a metadata form to the node and will extra structured metadata about the node.

Example

  • Create a MultiExpression to calculate 2+2 and 3+3 to show the result by storing the value in result_1 and result_2 variables.

Properties

  • Expressions:
    • result_1=2+2
    • result_2=3+3

result_1 and result_2 should be defined as Out parameters. See Variable Parameter in order to understand how to declare a variable parameter.

Decision

This is when the node acts like an If command but can be used in flow logic.

Summary

In a flow, you sometimes need to control the routing mechanisms and the execution path. This can be achieved using the Decision node. A Decision node in a flow has a Diamond shape.

This node has conditional transitions (ConditionalTransition) providing routing conditions using the condition attribute of the transition node.

Transitions

  • Incoming: 1+
  • Outgoing: 1+

Each outgoing transition from a Decision node has a Condition property that can be set. If the expression of the condition is evaluated to true that route is taken.

Properties 

  • Priority: When a Decision node has multiple outgoing transitions, priority will manage the order of the condition’s evaluation on a transition to select the route. Priority is an integer number.
  • Condition: The Condition’s expression allows conditional routing based on the evaluation of its expression. When it is evaluated to be true, that route (transition) will be selected.
  • Expression: When execution is transitioning to a target (destination) node, the Transition’s Expression will be evaluated. This is when evaluation of an expression (i.e. assigning a new value, creating an object, etc.) is required, before executing the next node.

Parameters

  1. name
    1. Description: Name of the node
    2. Mandatory: Yes
    3. Type: String

Example

Which has two outgoing transitions (arrows):

  • If input==0 –> result=No
  • If input==1 –> result=Yes

Therefore, conditions should be added to each outgoing transition separately, by clicking on the arrows.

Properties for transition named ”input==0”

  • condition: input==0

Properties for transition named ”input==1”

  • condition: input==1

One transition’s Condition’s expression can be left empty, which acts as the Else branch. When no transition’s conditions are validated to true, the else branch will be selected.

input should be defined as an In parameter. See Variable Parameter to know how to declare a variable parameter.

In this example, two activities have been created to show Yes and No. For those activities a variable called result was defined as an Out parameter

XML API

Sample

<Decision name="Decision1">
      <Transition name="TransitionYes" to="task1" condition='age ge 18' />
      <Transition name="TransitionNo" to="task2" />
</Decision>

Assign

Assigns a value to a defined variable. This node also acts like a Var command in Procedural Tree.

Summary

This node sets a value by running the given expression when it is reached by the execution.

Properties

  • Name: Name of the tool
  • Type: Type of the tool
  • Variable
    • Name: Name of the variable in which the value is assigned
    • Value: Value to assign

Example

Assign 1 as the value of a variable.

Properties

  • Variable
    • Name: result
    • Value: 1

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

XML API

Sample

<Assign name="Assign1">
      <Var name="StarQty" value="3" />
      <Transition name="Transition17" to="split0" />
</Assign>

Delay

Delay the process by a given number of milliseconds.

Summary

This command allows you to define a waiting period in the process. Wait time should be given in milliseconds.

Properties

  • Time: Waiting period in millisecond
  • Copy Result To: Copy the results of the command

Example

  • The process will wait for two seconds (2000 milliseconds)

Properties

  • Time: 2000

Group

Group commands in the flow are a set of nodes that are the containers for other nodes. They can contain one or more nodes and pass the execution to the initial node. When the execution reaches the final node, the container’s outgoing transition will be activated.

Scope

This command logically groups different sets of nodes. No extended behavior is applied.

Summary

Different sets of nodes can be grouped together to have a better understanding of the nodes’ groups and there will be no specific behavior.

Parameters

  • Name: Name of the node
  • Initializer: The starting node inside the Scope
  • FInalizer: The ending node inside the scope

Example

The example shows how to group a set of Activity nodes using Scope tool.

Properties

  • Initializer: <Starting node inside the Scope>
  • Finalizer: <Ending node inside the Scope>

In this example, there are 2 activities.

XML API

Sample

<Scope name="transactionGroup1" 
             initialNode="ActivityA" finalNode="ActivityB">
  <Nodes>
  …
  </Nodes>
  <Transition name="tr2" to="end"/>
</Scope>

Pool

Pool can be used to group nodes without any specific order and connection. This is mainly used for collecting data from different sources such as files and databases, and that does not require any connection to each other or their order.

Summary

Collects data from different sources to create a data pool.

Properties

  • Name: Name of the pool
  • Nodes: List of nodes in the pool

Example

  • The example shows how to group a set of data sources using Pool.
  • It will collect data from an Excel file, database, and another file and create a pool of data that can be accessed by other nodes.
  • There is no need of connecting them with each other or specify an order

Properties

  • Enable: True

Transaction

This command is used when there are several database calls that need to be queried in a transaction. All the database calls inside the transaction need to be successful in order to complete the complete transaction. If any of them fails, it will roll back the successful transactions and finally, it will not be completed.

Summary

Properties

  • Timeout: How long should it wait to complete all the transactions
  • Mode:
    • Required:
    • RequiresNew:
    • Suppress:
  • Initializer: Starting node
  • Finalizer: Ending node

Example

In this example, there are two databases. If the query in database A succeeded and B fails, in the end, it will roll back the database A query and the complete transaction will be marked as failed.

Properties

  • Timeout: 00:00:02 (2 seconds)
  • Mode: Required
  • Initializer: <Select starting activity from the drop-down list>
  • Finalizer: <Select starting activity from the drop-down list>

CriticalSection

This command defines a section where only one execution can be active inside the section. If an activity/resource inside a CriticalSection is being used by one process, and if another process tries to use the same activity/resource, it locks it for the first process to finish before being used by the second process.

Summary

When the same resource is used to be two processes, it locks the resource until the first process is finished using the resource.

Properties

  • Name: Name of the node
  • Type: Type of the node
  • Scope: Locking method around the critical section
    • SystemWide
    • Distributed
  • Scope Name: Name of the scope to acquire the lock for
  • Connection: Connection string to the central server (if the resource is a database)

Example

The example shows how to group a set of Activity nodes using the CriticalSection tool.

Properties

  • Scope: SystemWide
  • Scope Name: test_addition

To test the example,

  1. Open the same project twice
  2. Start running one project
  3. Once you get to the Activity node on the first project, start running the second opened project (You will see, in the second project, it will not be able to go inside the CriticalSection node)
  4. Stop the first project (It will automatically go inside the second project’s CriticalSection node.)

In this example, there is one Activity.

How to test CriticalSection tool by running the same project simultaneously.

Loop

If you want to recursively go through a given set of activities, the loop can be used.

Summary

Properties

  • Enter: The condition to enter the loop if the Behaviour type is While
  • Exit: The condition to exit the loop if the Behaviour type is While
  • Behaviour:
    • Iterator: List Source and Item Name should be provided to iterate through a given list
    • While: Enter and Exit conditions should be provided
    • Queue: List Source should be provided and it will loop through until the list is empty
  • List Source: List of items to loop through
  • Item Name: Name of the parameter to be set on each round of iterate with the element list
  • Index Name: Name of the parameter to be set on each round of iterate index of the list
  • Initializer: Starting node in the group
  • Finalizer: Ending node in the group

Example

In this example, it will loop through a list named input ( input = [1,2,3] ) and add each item to result in each round (result=result+i).

round 1: result = 0 + 1 = 1
round 2: result = 1 + 2 = 3
round 3: result = 3 + 3 = 6

finally, the value of the variable result is 6.

Properties

  • Behavior: Iterator
  • List Source: input
  • Item Name: i

Try

This node defines a scope such that if an exception happens, based on the exception type, a different route can be taken. It uses a custom prioritized transition to define the exception type. If no exception is defined in the transition, then it will try to execute the path that does not give any error and show exceptions.

See Exception Handling to know how you can catch exceptions without the Try node.

Summary

This node defines a scope such that if an exception happens, based on the exception type, a different route can be taken. It uses a custom prioritized transition to define the exception type. If no exception is defined in the transition, then it will try to execute the path that does not give any error and show exceptions.

Properties

Try Node Properties:

  • Name: Name of the node
  • Initializer: Starting node inside Try
  • Finalizer: Ending node inside Try

Transition Node Properties:

  • Type: The exception type to catch, use ‘System.Exception’ or ‘object’ to catch all exceptions. Use any other exception type for catching specific issues, for instance, System.Data.SqlClient.SqlException. When left blank it becomes a successful transition when there is no issue.

Example

  • In the given example, an activity is trying to do the calculation 1/0 (divide 1 by 0) which gives an exception.

Properties

Try Node Properties:

  • Initializer: <Starting node inside Try node>
  • Finalizer: <Ending node inside Try node>

Transition Properties:

This is the transition that connects the Try node and the Notification node.

  • Type: Object

 In this example, a Notification was added to show the exception message. It is an Error notification with the message Found Infinity!!!! {$context.Exception} to show the exception.

Only one transition that goes out of the Try node can be left empty. Other transitions must have a value in Type property.

XML API

Sample

<Try name="tryGroup1" initialNode="ActivityA" finalNode ="ActivityB">
  <Nodes>
  …
  </Nodes>
  <Transition name="tr2" to="ActivityC" priority="1" 
              exceptionType="FlexRule.FlexRuleException" 
              exceptionAssembly="FlexRule.Core.Library.dll"/>
 <Transition name="tr3" to="ActivityC" priority="2"
  exceptionType="System.Exception"/>
 <Transition name="trFinal" to="ActivityD" priority="3"/>
</Try>

General

Validator

Allows you to create and add validation documents to the flow.

Summary

Properties

  • Copy Results To: Boolean variable name to copy the result of validation into
  • Uri: Validation file path
  • Dynamic Routing:
    • True: The Uri is an expression
    • False: The Uri is a string
  • Name: Logic name if required
  • Name Reference: A variable that logic name is stored to
  • Parameters: Parameters to pass to the validation logic
  • Context Mode: It sets the way of having a context for the called decision table
  • Facts Check: List of facts to be checked against the defined constraints

Example

In this example, it will call an Input Validation Document called Validation.xml and copy the final result to isValid variable mentioning whether it passed the validation.

Properties

  • Copy Results To: isValid
  • Uri: Validation.xml
  • Dynamic Routing: False
  • Parameters: age

Notification

Allows you to create notifications and save these in a database.

Summary

This command allows you to create notifications in a process. It can also automatically create a table named FlexRuleEventLog to store all the notification messages instead of creating separate log files. Notification message types can be defined and these are:

  • Information
  • Warning
  • Error
  • Fatal

Properties

  • Name: Notification node Name
  • Notices Collection: Collection of notifications (Notification type can be selected from Information, Warning, Error, or Fatal)
    • Message: Simple text message that can be a Parameterized String.
    • Type: Error, Info, Warning, Fatal
    • Tag: When a tag is set to a GUID value, it will be used as an EventId if stored in the Database.
  • Storage
    • Dynamic Connection String: State whether the connection string is defined dynamically
    • Connection String: Connection String to connect to the database
    • Database Type: Type of the database

Example

In this example, the notification will be stored in a database.

This will automatically create the database table called FlexRuleEventLog. And then stores the notification messages.

FlexRuleEventLog table that stores notifications

Properties

  • Notices Collection:
    • Message: Error_Notification
    • Type: Error
    • Tag:
  • Storage
    • Dynamic Connection String: False
    • Connection String: Data Source=.\SqlExpress;Initial Catalog=Car-Insurance;User ID=sa;Password=123;MultipleActiveResultSets=True

Decision Table

Allows a call to a Decision Table (DT) document.

Summary

CallDecisionTable can be used inside a process flow if it requires connecting a Decision Table.

Properties

  • Context Mode: It sets a way of having a context for the called DRD
    • New
    • Shared
  • Uri: Connected DRD file name
  • Dynamic Routing:
    • True: The Uri address will be resolved at runtime. This allows you to decide what model to execute on-the-fly.
    • Flase: Bounded to a model statically
  • Parameters: Parameters connected to the flow

Example

  • A Decision Table is connected.

Properties

  • Context Mode: Shared
  • Uri: DecisionTable.xml
  • Dynamic Routing: False

For this example, it is necessary to create a sample DRD named DecisionTable.xml. See Decision Table in order to understand how to create a Decision Table.

Decision Graph

Allows a call to a Decision Graph document.

Summary

Inside a process flow, if it requires connecting a Decision Graph file, Decision Graph can be used.

Properties

  • Context Mode: It sets the way of having a context for the called Decision Graph
    • New
    • Shared
  • Uri: Connected DRD file name
  • Dynamic Routing:
    • True: The Uri address will be resolved on the runtime. This allows you to decide what model to execute on-the-fly.
    • Flase: Bounded to a model statically
  • Parameters: Parameters connected to the flow

Example

  • A Decision Graph file is connected to the process.

Properties

  • Context Mode: Shared
  • Uri: DRD.xml
  • Dynamic Routing: False

For this example, it is required to create a sample Decision Graph named DRD.xml. See Decision Graph to know how to create a Decision Graph

IRD

IRD connects an IRD document to a flow.

Summary

Properties

  • Context Mode: It sets the way of having a context for the called IRD
  • Uri: Path to IRD document
  • Dynamic Routing:
    • True: If the Uri is an expression
    • False: If the Uri is a string
  • Parameters: Parameters to pass to IRD

Example

In this example, it connects an Information Requirement Diagram called IR Diagram.xml to the flow.

Properties

  • Context Mode: Shared
  • Uri: IR Diagram.xml
  • Dynamic Routing: False

Sub-Flow

A Sub-Flow is a way to run an external Flow as part of a running flow by referring to the address of the external flow.

Summary

Sub-Flow allows calling a flow with another flow. When there is a complex flow with many nodes, the flow can be divided into separate flows and combine all in one flow using a Sub-Flow node.

Properties

  • Context Mode: It sets the way of having a context for the called Sub-Flow
    • New
    • Shared
  • Uri: Name of the connected file
  • Dynamic Routing: When true, the Uri address will be resolved on the runtime. This allows you to decide what model to execute on-the-fly. Otherwise false, which means it is bound to model statically.
  • Parameters: Parameters related to the Sub-Flow

Example

The example is the main flow of a set of sub-flows. Therefore, once the process starts to run, it will automatically call the two sub-flows, Assign.xml and Activity.xml.

Properties

Assign node:

  • Context Mode: Shared
  • Uri: Assign.xml
  • Dynamic Routing: False

Activity node:

  • Context Mode: Shared
  • Uri: Activity.xml
  • Dynamic Routing: False

The files, Assign.xml and Activity.xml should be created to run this example.

XML API

<Flow name="Mainflow" version="1.0.0.0">
  <Declaration>
    <Define name="a" direction="in"/>
  </Declaration>
  <Nodes>
    <Start name="Start1">
      <Transition name="Transition8" to="Activity1" />
    </Start>
    <End name="End1" />
    <Activity name="Activity1">
      <CallFlow contextMode="Shared">
        <FlowSource uri="Subflow.xml" />
      </CallFlow>
      <Transition name="Transition3" to="End1" />
    </Activity>
  </Nodes>
</Flow>

Decision Package

A Decision Package is a way to run an external package as part of a running flow by referring to the .frdp file.

Summary

Decision Package allows calling a package inside a flow.

If the package contains any inputs, you can also create the concept file by right-clicking on the package,

and selecting the concept file.

Properties

  • Dynamic Routing: When true, the Uri address will be resolved on the runtime. This allows you to decide what model to execute on-the-fly. Otherwise false, which means it is bound to model statically.
  • Packages: Package/ the list of packages (.frdp)

Example

The example contains a flow with a decision package. Therefore, once you run the flow, it will call the pre-built package (.frdp file).

Properties

Action:

  • Dynamic Routing: not selected
  • Packages: PersonTitleAge.frdp

The package, PersonTitleAge.frdp  should be created to run this example.

XML API

<Flow name="CallPackage">
<Declaration>
<Define name="person" type="Person" assembly="PersonTitleAge.Concept.xml" direction="In" />
</Declaration>
<Nodes>
<Start name="Start1">
<Transition name="Transition14" to="Activity11" />
</Start>
<End name="End1" />
<Activity name="Activity11">
<CallPackage contextMode="Shared">
<PackageSource uri="PersonTitleAge.frdp" />
</CallPackage>
<Transition name="Transition13" to="End1" />
</Activity>
</Nodes>
</Flow>

Natural Language

Allows a call to a Natural Language (NL) document.

Summary

Inside a process flow, if it requires connecting a Natural Language file, CallNaturalLanguage can be used.

Properties

  • Context Mode: It sets the way of having a context for the called DRD
    • New
    • Shared
  • Uri: Connected DRD file name
  • Dynamic Routing:
    • True: The Uri address will be resolved on the runtime. This allows you to decide what model to execute on-the-fly.
    • False: Bounded to a model statically
  • Parameters: Parameters connected to the flow

Example

A Natural Language file is connected.

Properties

  • Context Mode: Shared
  • Uri: NaturalLanguage.xml
  • Dynamic Routing: False

For this example, it is required to create a sample Natural Language file named NaturalLanguage.xml. See Natural Language to know how to create a Natural Language file.

Data Sources

Spreadsheet

This node allows the loading of data from a Spreadsheet and CSV files.

Summary

This command enables you to read the Spreadsheet files below as a data source:

  1. Xlsx
  2. Xls
  3. CSV

Properties

  • Type: File Type
    • Xlsx
    • Xls
    • CSV
  • Omit Object Index: By default, ObjectIndex property is created. When this is set to be true, no index property is created.
  • Trim Values: By default, all values are trimmed (no White character). Set to false, to disable it.
  • Sheet Name: Sheet name of the spreadsheet to load.
  • Return: Parameter name to store once data is retrieved from a spreadsheet
  • CSV Separator: The CSV separator character. (i.e., or |)
    • [space]
    • [tab]
    • [single quote]
    • [double quote]
    • [null character]
    • [form feed]
    • [vertical tab]
  • Rows: Filter rows on reading the document/ sheets. The comma (,) separated patterns to include rows inside the active sheet. Use a dash (-) to set a range or single number to the individual row address. i.e. 2, 4-6 will include rows number 2,4,5 and 6.
  • Uri: Path to the spreadsheet
  • Dynamic Uri: Threats the Uri as an expression that is going to be evaluated at runtime.
  • Maps: A set of collections that maps columns to a resulting property name of each object as a row.

Parameters of Maps:

  • Column: Column of the excel to map to
  • Property: Name of the object property to be created
  • Type: Type of data to be read from a column

Example

The example shows how to load data from a spreadsheet.

Properties

  • Type: CSV
  • Return: result
  • CSV Separator: ,
  • Uri: sp.csv
  • Dynamic Uri: False

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

XML API

Sample

<Activity name="Activity1">
  <Spreadsheet return="trans">
    <DataSource uri="D:\excels\diversity.xlsx" />
    <Map>
      <Add property="ScenarioID" column="A" type="int" />
      <Add property="PortfolioID" column="B" type="int" />
      <Add property="IssuerID" column="C" type="int" />
      <Add property="Portfolio" column="D" type="string" />
      <Add property="Issuer" column="E" type="string" />
      <Add property="IndustryID" column="G" type="int" />
      <Add property="MoodysIndustry" column="H" type="string" />
      <Add property="TradeDate" column="I" type="datetime" />
      <Add property="Amount" column="J" type="decimal" />
    </Map>
  </Spreadsheet>
</Activity>

DataSource with more rows

<Activity name="Activity2">
  <Spreadsheet return="list">
    <DataSource uri="employee.csv" separator="," trim="false" rows="2, 4-5"/>
  </Spreadsheet>
  <Transition name="Transition3" to="End1" />
</Activity>

Database

When loading data from a database is required, you can use this node. It can be any standard or a custom database.

The Database command in Flow is the same command that is used by Procedural logic.

See this article to read more.

Summary

This command defines the database to execute TSQL or a Stored Procedure against a data store. It supports built-in database types as well as custom databases (e.g., PostgreSQL). If your database is not built-in:

  1. Ms SQL
  2. Access
  3. Oracle
  4. ODBC

then you should provide a type address to IDbconnection and the related assembly.

Properties

  • Connection String: Connection String of the database
  • Dynamic Connection String: When true, the Connection String will be resolved on the runtime. This allows you to resolve the database connection string on the execution on-the-fly. Otherwise, false.
  • Database Type: Type of the database
    • MsAccess
    • MySQL
    • Oracle
    • Odcb
    • Custom (Alternatively, the type can be the CLR Type name including namespace that has the IDbConnection implementation.)
  • Custom Database Type: If you select Custom option from the above list, you have to provide the database type here
  • Custom Database Assembly: External assembly that the connection type implementation
  • Queries: Database queries. You can use Query Builder for this.

Internal Commands

SelectRowSelectValueSelectListExecuteNonQueryExecuteScalar

Example

In this example, it will connect to a MSSQL database named sample_db and select all the data from table test_table.

Properties

  • Connection String: Server=localhost\SQLEXPRESS;Database=sample_db;Trusted_Connection=True
  • DynamicConnection String: false
  • Database Type: MySQL
  • Queries: select * from test_table

XML API

Standard Database Type

<Database connection="Data Source=.\SqlExpress;Initial Catalog=Car-Insurance;User ID=sa;Password=123;MultipleActiveResultSets=True" 
          type="MsSql">
    <SelectList command="select ([Made]+'-'+[Model]) Car from [dbo].[HighRiskCars]" return="probList1" multi="True" />
</Database>

Custom Database Type

<Var name="cnn" value='"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Directory.GetCurrentDirectory()+ "\\DatabaseSample.mdb"' process="true"/>
<Database connection-ref="cnn" 
          type="System.Data.OleDb.OleDbConnection" 
          assembly="system.data.dll">
   <SelectValue command="select FName from person where id = @id" return="name">
     <Param name="id" type="System.Int32" value="1"/>
   </SelectValue>
</Database>

REST Client

This command (CallREST) allows you to communicate with any REST endpoint.

Summary

Allows collecting data through a REST API.

Properties

  • Address: Url and the Url Parameters for the REST API endpoint
    • Url: The target URL of the REST endpoint
    • Parameters: Url parameters of the REST API call. Use { and } to bind them to execution context Parameters.
  • Selector: Selector of the REST API
  • Headers: Header of the REST API
  • Verb: Method to call the API (GET, POST, PUT, DELETE, PATCH, HEAD, CONNECT, OPTIONS, TRACE)
  • Body: Expression as the Body payload to be sent by the REST call
  • Authorization: Credential of the API
    • Username: The username for the service authorization header
    • Password: Password for the service authorization header
    • Token: Access token of the client to communicate to a service endpoint
  • Results
    • Multiple: True selects multiple results (multiple objects)
    • Result Path: Property’s path expression
    • Copy Value To: Refers to a Variable parameter that the call result will be stored into it

Example

In this example, A set of data will be retrieved through a given REST API and stored in result variable parameter.

Properties

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

XML API

Internal Commands

Header

This command sets the headers of the request by using Param with name and value.

<Header>
    <Param name="..." value="..." />
    <Param name="..." value="..." />
    ... 
</Header>

Monad

The monad name must be select and it allows selecting specific attributes from the result and map them accordingly.

<Monad localName="" name="select">
    <Param name="..." value="..." />
    <Param name="..." value="..." />
    ...
</Monad>

Sample

<Activity name="Activity2">
  <CallREST url="https://ap2.salesforce.com/services/data/v20.0/query/?q={soql}" 
            verb="GET" 
            return="leads"
            resultPath="records" 
            bearerToken="{token.access_token}">
    <Header>
      <Param name="accept" value="application/json" />
      <Param name="Content-Type" value="applcation/json" />
    </Header>
    <Monad localName="" name="select">
      <Param name="Name" value="FirstName" />
      <Param name="Family" value="LastName" />
      <Param name="Email" value="Email" />
      <Param name="Country" value="Country" />
      <Param name="Company" value="Company" />
    </Monad>
  </CallREST>
  <Transition name="Transition9" to="End1" />
</Activity>

File

This node allows the loading of different files (text, binary, lines, XML, and JSON) from a location.

See Reading Files and Files to know more about reading files.

Summary

This tool can be used to retrieve the content of a file. The location can be a static address or a dynamic and be resolved at runtime.

Properties

  • Type: File type
    • Text
    • Lines
    • Binary
    • JSON
    • XML
  • Return: Name of the variable parameter to store retrieved file content
  • Uri: File path
  • Dynamic Uri: Specify whether the Uri is predefined or dynamically taken at runtime
    • True
    • False

Parameters

  1. uri
    1. Description: Fixed/static path to a file path (location)
    2. Mandatory: No
    3. Type: String (path of a file)
  2. uri-ref
    1. Description: A parameter that has the path value to a file location. This is an expression that is
      evaluated at runtime.
    2. Mandatory: No
    3. Type: Expression

Note – only one of uri or uri-ref must be specified.

Example

Data will be retrieved from a file named File.txt and stored in a variable parameter, result.

Properties

  • Type: Text
  • Return: result
  • Uri: File.txt
  • Dynamic Uri: False

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

XML API

Inside each File command, the source of the file to be retrieved must be specified. The source location can be static or dynamic.

This node has to be a child of File.
Sample

<Activity name="Activity1">
    <File return="content">
        <FileSource type="Json" uri-ref="path" />
    </File>
    <Transition name="Transition2" to="End1" />
</Activity>

Internet

Send Email

To send emails.

Summary

This tool can be used to send emails. It also has the facility to create a list of email addresses.

Properties

  • Recipients: List of email addresses
    • From
    • To
    • Cc
    • Bcc
  • Content: Content of the email
    • Body
    • Subject
    • Html
    • Attachments
  • Server: Email server details
    • Host
    • Port
    • SSL
    • Timeout
  • Credential: Server Credential
    • User
    • Password

Example

An email will be sent from the given From email address to To email address.

Properties

  • Recipients
    • From: Add your email address
    • To: Add a receiver’s email address
  • Content
    • Body: Message to send
    • Subject: Subject of the email
  • Server: Email server details
  • Credential: Credentials of the server

Tutorial

Sending Email

FTP

Check File Exists

To check whether the file exists in a given FTP server.

Summary

The ‘Check File Exists’ tool in the toolbox allows you to check the existence of a file on the remote FTP server. This Flow shows how to check if a file already exists on an FTP Server (depending on the result of this Flow, a notification can be generated).

Properties

  • FTP Connection: FTP connection details in the format, ftp://<username>:<password>@domain (eg: ftp://testuser:123@127.0.0.1)
  • Remote File Address: File path (It should always start with a ‘/’)
  • Copy Result To: Copy the result (true if the file exists, false if not) to an output variable.

Example

result will be true if the file exists.

Properties

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

We used Filezilla to create the FTP server to test the sample.

List File and Folder

List the files and folders in a given FTP server.

Summary

List the files and folders of a given location in an FTP server

Properties

  • FTP Connection: FTP connection details in the format, ftp://<username>:<password>@domain (eg: ftp://testuser:123@127.0.0.1)
  • Remote File Address: File path (It should always start with a ‘/’)
  • Copy Result To: Copy the result (true if the file exists, false if not) to an output variable.

Example

List of files and folders will be copied to result variable parameter.

Properties

List File and Folder result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

 We used Filezilla to create the FTP server to test the sample.

Download

Allow the download of files from a given FTP server.

Summary

Properties

  • FTP Connection: FTP connection details in the format, ftp://<username>:<password>@domain (eg: ftp://testuser:123@127.0.0.1)
  • Remote File Address: File path (It should always start with a ‘/’)
  • Save File Locally As: Local file path and name to same the downloaded file
  • Copy Result To: Copy the result (true if the file exists, false if not) to an output variable.

Example

  • File will be downloaded to the given path
  • File details will be copied to result variable

Properties

  • FTP Connection: ftp://testuser:@127.0.0.1
  • Remote File Address: /1.txt
  • Save File Locally As: copied_1.txt
  • Copy Result To:result

Downloaded file details

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

 We used Filezilla to create the FTP server to test the sample.

Upload

Allow the upload of files to a given FTP server.

Summary

Properties

  • FTP Connection: FTP connection details in the format, ftp://<username>:<password>@domain (eg: ftp://testuser:123@127.0.0.1)
  • Local File Address: Local file path and name that requires to be uploaded
  • Save File Remotely As: Remote file path and address (It should always start with a ‘/’)
  • Copy Result To: Copy the result (true if the file exists, false if not) to an output variable.

Example

  • File will be uploaded to the given path in the server
  • File details will be copied to result variable

Properties

  • FTP Connection: ftp://testuser:@127.0.0.1
  • Local File Address: copied_1.txt
  • Save File Remotely As: /1.txt
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

 We used Filezilla to create the FTP server to test the sample.

Processes

Run

To run an executable file

Summary

Properties

  • Command: File name/ full file path of an executable file or command to execute
  • Command Arguments: A string that is passed as the argument of the command
  • Copy Result To: Copy the result of the command

Example

  • Run a bat file named ‘sample.bat’

Properties

  • Command: sample.bat
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

List

List the processes currently running on the machine.

Summary

Properties

  • Copy Result To: Copy the result of the command

  • Get a list of currently running processes and copy results to result variable parameter

Properties

  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

[/ht_toggle]

Kill

Allows terminating a running process in the machine with its PID.

Summary

Properties

  • Process Id: PID or the ID of the running process you want to terminate
  • Copy Result To: Copy the result of the command

Example

  • Kills a process using a given PID and copies results to result variable parameter

Properties

  • Process Id: <PID of the running process you want to kill>
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

IO

Files

Write File

Create a file with its content in a given location

Summary

Properties

  • Path: Filename and path to create the file
  • Content: File content
  • Copy Result To: Copy the result of the command

Example

  • Creates a file named test.txt and copies results to result variable parameter

Properties

  • Path: pathCombine(pathCurrent(),’SampleFiles\\test.txt’) (Value Type should be Expression for this example)
  • Content: test content
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

Append File

Append a file with its contents to another given file.

Summary

Properties

  • Path: Filename and path to append the new content
  • Content: New file content
  • Copy Result To: Copy the result of the command

Example

  • Append ‘Appending New Content’ to a file named test.txt and copy results to result variable parameter

Properties

  • Path: pathCombine(pathCurrent(),’SampleFiles\\test.txt’) (Value Type should be Expression for this example)
  • Content: Appending New Content
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

File Exists Check

Check whether the file exists in a given location

Summary

The ‘Check File Exists’ tool in the toolbox allows you to check the existence of a file in a given folder (depending on the result of this Flow, a notification can be generated).

Properties

  • Path: The path to check the file existence
  • Copy Result To: Copy the result (true if the file exists, false if not) to an output variable.

Example

result will be true if the file exists.

Properties

  • Path: pathCombine(pathCurrent(),’SampleFiles’)
  • Remote File Address: /FC_Start_example.png
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

 We used Filezilla to create the FTP server to test the sample.

Delete File

Delete a given file.

Summary

Properties

  • Path: Filename and path to delete
  • Copy Result To: Copy the result of the command

Example

  • Delete a file named test.txt and copy results to result variable parameter

Properties

  • Path: pathCombine(pathCurrent(),’SampleFiles\\test.txt’) (Value Type should be Expression for this example)
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

Folders

Create Folder

Create a folder in a given location.

Summary

Properties

  • Path: Full path of the folder to be created
  • Copy Result To: Copy the result of the command

Example

  • Creates a folder named NewFolder and copies results to result variable parameter

Properties

  • Path: pathCombine(pathCurrent(),’SampleFiles\\NewFolder’) (Value Type should be Expression for this example)
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

Folder Exists Check

Check whether the folder exists in a given location.

Summary

Properties

  • Path: Full path of the folder to check
  • Copy Result To: Copy the result of the command

Example

  • Checks whether a folder named NewFolder exists and copies true or false to result variable parameter

Properties

  • Path: pathCombine(pathCurrent(),’SampleFiles\\NewFolder’) (Value Type should be Expression for this example)
  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

Current Folder

Get the path of the current folder

Summary

Properties

  • Copy Result To: Copy the current folder path

Example

  • Gets the current folder location and copies the path to result variable parameter

Properties

  • Copy Result To: result

result should be defined as an Out parameter. See Variable Parameter to know how to declare a variable parameter.

Updated on May 9, 2022

Was this article helpful?

Related Articles