Conditions
Conditions are the central element in the workflow system. They determine a set of prerequisites that must be fulfilled, so that a workflow task can be initiated or completed.
The Conditions page is accessed using Tell Me. Choose the icon, enter Conditions, and then choose the related link.
Select an existing condition or create a new one.
General FastTab
The fields on the General FastTab are described in the following table.
Field | Description |
---|---|
No. | The No. field is a precise identifier of the Workflow Condition and permits the maximum amount of 20 characters. |
Description | Insert a concise characterization for the condition using the Description field. The description should encapsulate what will be evaluated as valid, for example, Item Purchase Data gathered or Item Purchase Data incomplete. The Description permits the maximum amount of 80 characters. |
Source Table No. | The Source Table No. field is a mandatory field because it identifies the primary table the condition refers to. The condition proves a data record of this table to decide about the release of a Workflow Task. Choose the ellipsis button to open the table overview, then select the appropriate table. Note: After selecting the primary table, the table will be automatically listed in the Condition Tables page additionally a condition line with this table and with a line no. 10.000 will be created. It is not possible to delete this line. |
Table Caption | The label of the primary table will be displayed in the Table Name field. |
Status | Specifies the status of the condition. A condition will only be validated by the application, if the status is Certified. The options are: - New – Select this option for a new Condition. It is possible to change the fields content. - Certified – Select this option to certify the Condition. It is not possible to change the fields content. Only certified Conditions will be validated by the application to process tasks. - Under Development – Select this option for a Condition which is currently under development. It is possible to change field values. - Closed – Select this option for a condition that will not be used anymore. Note: If a workflow contains a condition that is not certified, the dependent Workflow task will not be started. |
Workflow Category | To group workflows by topics, the Workflow Category should be used. In this field a Workflow Category Code can be added or selected using the drop-down. |
Valid From / Valid Through | Limits the validity of the Condition to a selected period. Only applicable conditions will be validated by the application. Hence an initiation of a workflow will not be realized, if its condition is expired. |
Log | Selecting the Log toggle affects the validated condition logging, thus Condition Entries will be created, if the Condition comes into effect. In the course of this, the validation time, result, and the field values will be saved. |
User specific | The User specific toggle indicates that the condition should only be checked for certain users, roles, or teams. The user-specific check only takes place for entry conditions that were triggered by a workflow event. For more information on how to define users, roles, or teams, see User-Specific Condition. The field is a FlowField and cannot be edited directly. |
User-defined FastTab
The fields on the User-defined FastTab are described in the following sections.
User-Defined Expression
The specified criteria of all condition lines must be fulfilled for a condition to apply. The evaluation of the condition result is AND-based for each condition line. If you want to set up an OR-based evaluation of the condition lines so that not all lines have to be true, you can logically link the line numbers manually.
Turn on the Enabled toggle to control the validity of the condition lines with logical expressions. In this way, you can reduce the amount of conditions and summarize separate similar workflows.
Use logical operators AND, OR, and brackets to build a user-defined expression.
Example
Two conditions are consolidated in one condition.
Line No. | Condition 1: Item basic data entered |
Condition 2: Item general ledger data entered |
Condition 3 (1+2): Item basic/general ledger data entered |
---|---|---|---|
10.000 | Item Table | Item Table | Item Table |
20.000 | Description <>’’ | Inventory Posting Group <>’’ | Description <>’’ |
30.000 | Base Unit of Measure <>’’ | Gen. Prod. Posting Group <>’’ | Base Unit of Measure <>’’ |
40.000 | Item Category Code <>’’ | Product Group Code <>’’ | Item Category Code <>’’ |
50.000 | Inventory Posting Group <>’’ | ||
60.000 | Gen. Prod. Posting Group <>’’ | ||
70.000 | Product Group Code <>’’ |
The user-defined expression for the consolidated condition is:
(20000 AND 30000 AND 40000) OR (50000 AND 60000 AND 70000)
Condition 3 of the example will be evaluated as true, if the Item basic data entered part or the Item general ledger data entered part or both are fulfilled.
Thus condition 3 is evaluated as true if either the Item basic data entered part (line no. 20.000 to 40.000 - description and base unit of measure and item category code are filled) or Item general ledger data entered (line no. 50.000 to 70.000 - inventory posting group and product posting group and product group code are filled), or of course both logical branches are fulfilled.
Custom Function Code
User-defined functions allow you to perform condition checks in the source code that go beyond the capabilities of the condition page. Each user-defined function is uniquely identified by a code. In the Code field, select the required function code.
Note
If a condition is checked by a user-defined function, any created condition lines are ignored. The whole condition check must take place in the source code. Nevertheless, you should provide necessary condition tables and link them with each other correspondingly.
User-Specific Condition
It is possible to use user-specific conditions to address a condition specific to Users, Roles, or/and Teams. If a Condition is User specific, it will only be validated for the defined target group. The Users, Roles, and Teams are added by choosing the Users action on the action bar. The User specific toggle shows whether the condition will be checked. The field is a FlowField and cannot be edited.
In the Type field of the Condition User page, you can choose User, Permission Set, or Team and in the ID field you can enter the desired User ID, Role ID, or Workflow Team Code. Use the drop-down to select an entry from a list.
If the Excluded check box is selected, the specific User, Role, or Team is explicitly excluded from the condition check and workflow execution.
The Name field shows the name of the User, Role, or Team.
Note
For this purpose an entry event must be specified in the workflow, since the user check takes place only for those conditions that are automatically triggered when an event is initiated. A user check will not be done for manually triggered workflows.
FactBoxes and Functions
The FactBoxes and functions on the Condition page that are specific to Conditions are described in this section.
Utilization
The Condition Statistics FactBox shows the utilization of the Workflow Conditions.
- The Used as Entry Condition and Used as Exit Condition fields show in how many Workflow Lines the condition is used as an Entry or Exit Condition.
- The Used in Approval Conditions field shows in how many Approval Conditions the condition is used.
- The Used in Messages field shows in how many Messages the condition is used.
Add Fields
Having added one or more tables, fields can be added to the Condition Lines. To add fields, you have the option to select them manually by inserting one or more new lines with a table field each. Alternatively, the automatic option is available. Choose Functions > Add Fields on the Actions menu.
To add more than one field to the Condition Lines, select all needed fields in the Fields page. Then choose the OK button to confirm and apply the changes to the Condition Lines.
The selected fields will be inserted as condition lines underneath the existing lines (field or variables) of the reference table.
Copy from Condition
Choose Functions > Copy from Condition on the Actions menu to copy the existing condition to an already created condition. The status of the target condition must be New and it must be empty, that means no lines, no tables, and no comments.
Starting from the list view, it is possible to copy an existing condition without creating a new one. You select the condition you want to copy and choose the Copy from Condition action. The new condition will be created utilizing the provided condition numbering defined on the Workflow Setup page.
Replace Condition
Choose Functions > Replace Condition on the Actions menu to replace an existing condition by a new created condition. The replacement will be effective where the initial condition was used, that means in any Entry/Exit Condition, Approval Condition, and Messages.
To replace an existing condition by a new one, first open the condition, that you aim to replace, then choose the Replace Condition action. A list of existing conditions will be opened where you select the new condition. Choose the OK button to start the replacement process.
Condition Entries
You can find more data of the condition by choosing the Entries action on the action bar. Here you get access to the Condition Entries, Tables, and Users.
In the Condition Entries, all logged validations of a condition are listed with Date, Time, and User ID. The Condition Valid field is checked when the condition was validated as true and the Workflow Task was started.
The Fields action on the action bar of the Workflow Condition Entry shows the content of the processed fields regarding the data record at the moment of the validation after change as well as the field value before change.
Condition Tables
Choose the Tables action on the action menu. The Condition Tables page is described in this section.
Condition Tables – References
After having determined the primary table in the header of the condition, the Source Table No. field, automatically the first Condition Line is created and the Primary checkbox is selected. The Primary checkbox identifies the table as the source table of the condition. This source table is the base for the data record, which is to be validated in the condition. Further tables that should be validated by defined references to the primary table are labeled as secondary tables, without any mark.
The Table value in the Type field together with the ID determine which table the current line is referring to. You define additional secondary tables directly by adding Condition lines or in the Condition Tables page, which you get by choosing the Tables button on the action bar. To define table connections, it is necessary to add the reference table in the Reference ID field. This is the prerequisite for field validation of reference tables, which are used to create Workflow Tasks.
The Table ID field provides the possibility to use a Table No. more than once. Determine a code for up to 20 characters. The code is displayed in the condition line, ID field. If you fill in a valid table in the condition line, the Table ID will be predefined with the table number.
In the Condition field, you can select a condition that must be met for the related tables, to make a condition relation valid:
- <Blank> – The condition for the table always valid. This is used for the primary table because the value is always true.
- Records exist – The condition is only valid if at least one record exists in the through field filters related table.
- No Records – The condition is only valid if there are no records in the through the field filters related table.
Variables show if one or more variables are defined for the condition tables.
In the Key No. field, you may define a key to sort the secondary tables appropriate to the table connection. This field is not relevant for the primary table, for secondary tables it is optional. 0 is the default value and uses the primary key of the table, thus 0 has the same impact as 1. The Key Caption field shows the names of the key fields.
Variables
Variables make it possible to ascertain values for condition tables. For this the application uses predefined functions. The ascertained value may be used in the Condition Line of its table (source of the value) as well as a field filter for a table at a higher level related (source table of the table relation).
Starting from the condition, open the Condition Tables by choosing the Tables action. Select the line you would like to define a variable for and choose the Variables action.
Insert a precise expression in the Variable Name field with a maximum length of 20 characters. The Variable Name must be unique in one condition. Enter a Variable Description for the variable.
There are two different types of variables: Table and Field Variables.
Table Variables
Leave Field No. blank to select a Function Code data record.
The following data record functions are initially available in COSMO Workflow:
- COUNT – counts the number of data records in a table
- HASLINKS – Gives back a Boolean value, if in the table a data record link is existing.
Field Variables
To create a field variable, select a Field No. to be able to select a Function Code field.
The following field functions are available in COSMO Workflow:
- AVG – calculates the arithmetical average for the table field over all data record in the table
- MAX – ascertains the highest field value for the table field over all data record in the table
- MAXSTRLEN – ascertains the maximal number of characters in a table field
- MIN – ascertains the lowest field value for the table field over all data record in the table
- STRLEN – ascertains the number of characters for one data record in the table
- SUM – calculates the sum for the table field over all data record in the table
The result of field functions with the data type Integer or Decimal are optionally negatable by selecting the Reverse Sign checkbox.
Condition Lines
In the Condition Lines, you define the state (set value) of a data record to initiate or to close a Workflow Task. That works for a simple condition as well as for a condition with a complex table-field relation.
The Level field shows the logical structure of the condition lines and is calculated automatically by the application. The primary table in the condition line 10.000 always belongs to level 0.
The Type field defines what the condition line is treating with. With a selection in this field further column definitions of the selected line are influenced.
The logical, where appropriate, repeating structure of condition lines is: Table Type followed by Field and, if applicable, Variable.
Example
Level | Type / ID | Link Type / Reference ID |
---|---|---|
0 | Primary Table A | |
1 | Field A1 | |
1 | Field A2 | |
1 | Primary Table B | Linked with Primary Table A |
2 | Field B1 | Linked with Field A2 |
2 | Field B2 | Filtered on one value |
The selection in Type has a direct influence on the ID field:
- Table – the Condition Table should be inserted in the ID field. On this table field validation of the condition will be performed. The following Condition Lines contain the fields or variables with the reference on this table.
- Field - the ID field contains the number of the table field, on which the validation of the condition will be performed.
- Variable - for the ID in this case the name of the variable must be chosen.
After selecting the ID, the Caption field will be filled automatically through the applications language. The English translation is displayed in the Name field. Both fields may be changed arbitrarily.
Comparison defines how the chosen field of the line should be compared with the particular condition. The following mathematical operators are available to be selected: Equals (=), greater than (>), less than (<), greater or equal (>=), less or equal (<=), and unequal (<>).
The Condition Type field contains the type for the current line. It determines what the given table field should be compared with. The options are:
- Field – The content of the selected field will be compared to another field.
- System – The content of the selected field will be compared to a pre-defined system condition. The options are: Workdate, Date, Previous Value, Time, Date and Time, and User ID.
- Filter – The content of the selected field will be compared to a field filter.
- Date – Allows entering a date calculation formula in the Date Formula field. The date calculation formula always relates to the current date. The ascertained value will be compared to the date field of the condition line.
Reference ID is directly influenced by the selection in the Type and Condition Type fields:
- Type = Table – Insert in Reference ID Condition Table of the previous line or the Condition table you want to refer to for the field mapping. In the following lines, you configure the field mappings to the selected table field in Reference ID if the Type is Field or Variable and the Condition Type is Field.
- Type = Field or Variable and Condition Type = Field - Insert the field number in Reference ID, belonging to the references table. With this selection, the ID field (related table = previous row type table: ID) will be connected with referenced field of the same row (previous row type table: Reference ID).
After selecting Reference ID, the Reference Caption field will be filled automatically through the application language. The English translation is displayed in the Reference Name field. Both fields may be changed arbitrarily.
The Condition Description field shows the following:
- Condition Type = System = the description of the selected System Condition.
- Condition Type = Field = the name of the referenced field.
This field may be changed arbitrarily.
In the Condition Filter field, you can enter a field filter, such as <>’’ or 100..200, if Condition Type = Filter. Setting a filter for a field (for Option datatype), it is also possible to directly select one of the possible field options through lookup.
The Comparison column may be combined with Condition Filter.
Note
This field is only relevant for the Condition Type = Filter.
In the Date Formula field, you must enter a date calculation formula, such as 10T, -3T, or 1W, if Condition Type = Date.
Note
This field is only relevant for the Condition Type = Date.
The Auto adjust Filter checkbox is selected by default. Through this the application verifies the inserted filter criteria for its validity and rectifies if necessary or displays an error message. Clear the checkbox, if you do not want a rectification.
Note
If you decide to avoid Auto adjust Filter in the Condition Line, consider the Data Type (Field Type Name) of the field. As the validity of the entered Condition Filter in reference to the data type is not proven, while gathering Workflow Lines, a run-time error may occur when the Condition will be validated.
The Language field stores the Windows Language ID of the current application language when you create a Condition Line. This ID is used to convert the provided Filters between the available languages of the application within a company.
The language ID 1031 stands for German (Germany) and 1033 for English (USA).
Feedback
Submit feedback for this page .