Decision nodes
Introduction to decision nodes
A decision node is a node which has one or more entry points and exactly two exit points: true and false. A decision node always has to have a script which has to return either true or false.
The ticket enters the decision node, then the script is executed and - depending on the result (true or false) - the ticket leaves the node via the respective exit point.
Figure 52: ConSol CM Process Designer - Decision node
Properties of a decision node
Decision nodes have the following properties:
-
name
Mandatory, the technical object name.
-
label
Optional, the localized name which is displayed in the Web Client GUI.
-
condition
Mandatory, a script which returns true or false has to be provided.
-
history visibility
Mandatory. This property defines on which display levels the execution of the activity is shown in the ticket history in the Web Client. The possible values are:
- 2nd level and 3rd level
- only 3rd level
- on every level
- default (default value)
The activity is shown on the display level which is configured in the Admin Tool, navigation group Tickets, navigation item History. Depending on the type of activity, one of the following settings is used:
- Manual activity or activity with overlay executed
- Activity executed after escalation
- Automatic activity executed
- hidden on all levels
The execution of the activity is never displayed in the ticket history of the Web Client.
Figure 53: ConSol CM Web Client - Display levels in the ticket history
-
disable auto update
Defines the behavior of the ticket when an event has been fired or executed. Usually, after an event, a ticket update operation is performed automatically. In case a chain of events is used you should avoid triggering a ticket update operation after every single event. To avoid this, set disable auto update to true in all events except for the last one. Then, the ticket is only updated once, after the last event.
Example of a decision node
In the following example, the system should automatically check if the customer (main contact of the ticket) is a VIP customer. If yes, the ticket should be marked with the VIP overlay (in the example a yellow star).
-
A customer field of type boolean has to be defined in the customer data model (FlexCDM) to mark a customer as VIP (yes/no). Please refer to the ConSol CM Administrator Manual, section Setting Up the Customer Data Model.
Figure 54: ConSol CM Admin Tool - Customer field "vip" in customer data
Figure 55: ConSol CM Web Client - Customer field "VIP" for customer/contact data
- In the script of the decision node, it has to be checked if the customer is a VIP (return value: true) or not (return value: false).
-
When a ticket has passed automatically through the decision node and the following automatic activity where the VIP overlay is added, the ticket icon in the Web Client is marked with the overlay, see following figure.
It is important that the overlay range is set to process. Otherwise the overlay will be removed as soon as the ticket leaves the activity or scope and will, in the example configuration, not be visible in the process.Figure 56: ConSol CM Web Client - Ticket icon with VIP overlay
import com.consol.cmas.core.server.service.*
import com.consol.cmas.common.model.customfield.meta.UnitDefinitionType
def ticket = workflowApi.ticket
// fetch main contatc of the ticket
def maincontact = ticket.getMainContact()
def unit_type = maincontact.definition.type
log.info 'vipCheck: Unittype is ' + unit_type
log.info 'vipCheck: Unittype class is ' + unit_type.getClass()
if(unit_type == UnitDefinitionType.COMPANY) {
log.info 'No vipCheck for comapnies possible! Returning false ... '
return false
} else if (unit_type == UnitDefinitionType.CONTACT){
// fetch e-mail address of the man contact. The data object group field has to be addressed using data object group name:data object group field name
def vip_field
def custgroup = maincontact.customerGroup.name
println 'vipCheck: Customergroup is now ' + custgroup
switch(custgroup) {
case "Reseller": vip_field = "vip_person";
break;
case "DirectCustomers": vip_field = "vip_dircust"
break;
case "MyCustomerGroup": vip_field = "vip"
break;
case "OurPartnerCompanies": vip_field = "vip_partners"
break;
case "RetailCustomers": vip_field = "retail_vip"
break;
}
def vip_value = maincontact.get(vip_field)
log.info 'VIP is now ' + vip_value
if (vip_value){
return true
} else {
return false
}
}
Code example 7: Precondition script: activity should only be displayed for VIP customers