Newer Version Available

This content describes an older version of this product. View Latest

MilestoneTriggerTimeCalculator Interface

The Support.MilestoneTriggerTimeCalculator interface calculates the time trigger for a milestone.

Namespace

Support

Implement the Support.MilestoneTriggerTimeCalculator interface to calculate a dynamic time trigger for a milestone based on the milestone type, the properties of the case, and case-related objects. To implement the Support.MilestoneTriggerTimeCalculator interface, you must first declare a class with the implements keyword as follows:
Next, your class must provide an implementation for the following method:

The implemented method must be declared as global or public.

MilestoneTriggerTimeCalculator Methods

The following are instance methods for MilestoneTriggerTimeCalculator.

calculateMilestoneTriggerTime(caseId, milestoneTypeId)

Calculates the milestone trigger time based on the specified case and milestone type and returns the time in minutes.

Syntax

public Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId)

Parameters

caseId
Type: String
ID of the case the milestone is applied to.
milestoneTypeId
Type: String
ID of the milestone type.

Return Value

Type: Integer

The calculated trigger time in minutes.

MilestoneTriggerTimeCalculator Example Implementation

This sample class demonstrates the implementation of theSupport.MilestoneTriggerTimeCalculator interface. In this sample, the case’s priority and the milestone m1 determine that the time trigger is 18 minutes.

This test class can be used to test the implementation of Support.MilestoneTriggerTimeCalculator.