# Class: BusinessDeadlineService

## tibco.objectapi.service.BusinessDeadlineService

#### new BusinessDeadlineService()

### Methods

#### calcDeadline(request, callback)

METHOD: calcDeadline Calculates the earliest date and time a deadline can be completed, given a start date/time and duration. The start date/time must be specified as UTC, and the response will also be specified as UTC.

The calculation request also includes an optional, ordered collection of identifiers from which a Calendar can be resolved. Those identifiers will consist of Calendar references and Organizational Entities, as set out in the following list, and will be applied in the given order until a Calendar can be resolved.

1. Time Event Calendar Reference (can be defined dynamically using a variable assignment)
2. Single, Org-Model Entity Participant
3. Process Calendar Reference

For the deadline calculation of a User Activity, the Organizational Entities will be derived from the participant. If a User Activity, or Timer Event, declares more than one participant, those participants should not be used to perform deadline calculation (i.e. the participant should only be passed if it identifies a single Organizational Entity).

The Organizational Entity identifiers are used to determine what Base and Overlay Calendars are to be used for the calculation. If no Calendar can be resolved from the given identifiers, the Default Base Calendar will apply.

Having resolved the Calendar(s), the available working hours are determined. Based on those available hours, the calculation returns earliest date and time at which the given duration of work can be completed.

If the given duration specifies any hours, minutes or seconds, the deadline is calculated using any available time. Otherwise, the deadline will be calculated using 'whole working days'. A 'whole working day' is considered to be one in which the available hours is at least the 'min hours' defined for the Base Calendar being used.

##### Parameters:

Name | Type | Description
--- | --- | ---
`request` | tibco.objectapi.service.request.CalcDeadlineRequest | A request set with data for this service call.
`callback` | tibco.objectapi.service.Callback | A callback to handle the service response of type `XmlCalcDeadlineResponse`.