Reopen activities

Introduction to reopen activities

Once a ticket is technically closed, i.e., it reaches an end node in the workflow, it cannot be edited in any way and there are no activities for this ticket. Depending on the business process, it might be required to reopen such tickets. This can be modeled using a reopen activity.

Example use cases for reopen activities are:

When using a reopen activity, the ticket does not return to the start node, but re-enters the process at the location defined by the outgoing connections of the activity. Reopen activities do not have any incoming connections. They are visible in the scope where they are located and in any subscopes of this scope.

Properties of a reopen activity

Reopen activities have the following properties:

For expose to users the icon which is also used for manual activities is attached to the reopen activity. The option expose to customers is indicated by the icon which is also used for this purpose in manual activities.

If neither expose to users nor expose to customers is selected, the reopen activity can only be executed via script.

Process logic of reopen activities

The ticket is reopened as soon as the reopen activity is executed. The further processing depends on the outgoing connections of the reopen activity. The process logic of reopen activities is the same as for regular activities (see Process logic of activities).

Please consider the impact of reopening closed tickets on the designed workflow as a whole. The following list shows some examples of areas which might need adaption when introducing reopen activities.

Use a script in the reopen activity or place an automatic activity containing a script after the reopen activity in order to add the required logic.

Example for the use of reopen activities

Example 1: Reopen a closed ticket when an email is received

The default behavior when an email is received for a closed ticket is to create a new ticket and create a relation between the new ticket and the original ticket for which the email was received. If you would like to reopen the original ticket instead, you can add a reopen activity to the scope where the end node is located and execute this activity in the incoming email processing script.

Please follow the following steps:

  1. Add a reopen activity to the scope or scopes containing end nodes.
  2. Create a connection from the reopen activity to the activity where the ticket processing should continue.
  3. Edit the NimhIncomingMailRouting.groovy script in the Admin Tool to add the logic to reopen the ticket.
  4. Deploy the workflow and test it.

The following figure shows the part of the workflow with the end scope and reopen activity.

Figure 51: ConSol CM Process Designer - Workflow with a reopen activity

The following example shows the NimhIncomingMailRouting.groovy script from the Admin Tool. The lines highlighted in red have been added to reopen the ticket if the reopen activity is present.

import com.consol.cmas.common.model.ticket.Ticket

 

mailLog.info("Routing " + mailHolder.getUid())

if (log.isDebugEnabled()) {

log.debug("Available endpoints for mail routing are " + endpoints.keySet().join(", "))

}

 

// Append to ticket if ticket id can be extracted

def ticketName = mailSupportService.extractTicketNameFromMail(mailHolder, pipeContext, TICKET_NAME_PATTERN_FORMAT)

if (ticketName) {

Ticket ticket = ticketService.getByName(ticketName)

if (ticket) {

pipeContext.setAttribute("ticket-id", ticket.getId())

if (ticket.getScopeInfo().isClosedOrDeleted()) {

 

//if ticket is closed, check if it can be reopened

if (ticketService.getNextActivities(ticket).name.contains("defaultScope/Service_Desk/End_positive/Reopen")) {

activity = ticketService.getNextActivities(ticket).first()

ticketService.executeActivity(ticket, activity)

return endpoints["appendToTicketScript"]

} else {

return endpoints["mailToClosedTicketScript"]

}

} else {

return endpoints["appendToTicketScript"]

}

}

}

 

// Default is creating a new ticket

return endpoints["createTicketScript"]

Code example 6: NimhIncomingMailRouting.groovy adapted to reopen a ticket if an email is received