This chapter discusses the following:
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 51: ConSol CM Process Designer - Decision node
A decision node has the following properties:
Figure 52: ConSol CM Process Designer - Decision node: Properties
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).
Figure 53: ConSol CM Admin Tool - Data Object Group Field "vip" in customer data
Figure 54: ConSol CM Web Client - Data Object Group Field "VIP" for customer/contact data
// Get the main contact of the ticket. The unit object (can be a customer or a company) is provided;
// here it has to be a customer, i.e. a contact:
Unit mycontact = ticket.mainContact
// Check the Custom Field "vip" of the main contact. (see next image)
// If it is set to true, return true, i.e. the condition is TRUE.
// Else return false, i.e. the condition is FALSE:
if (mycontact.get("vip")) {
return true
} else {
return false
}
Code example 6: Working with customer data - Example: Using a Data Object Group Field of type boolean
Figure 55: ConSol CM Web Client - Ticket icon with VIP overlay