Handles the loading and updating of data fields and behaviour of a single Task object managed by a TaskContentService instance.

Hierarchy (view full)

Implements

  • OnDestroy

Constructors

Properties

_afterActionFactory: CallChainService
_changedFieldsService: ChangedFieldsService
_dataReloadSubscription: Subscription
_eventQueue: EventQueueService
_eventService: EventService
_fieldConverterService: FieldConverterService
_frontActionService: FrontActionService
_selectedCaseService: SelectedCaseService = null

an optional service, that holds the currently selected case. It should be injected with the @Optional() annotation, since it might not be always provided.

_snackBar: SnackBarService
_taskContentService: TaskContentService

the service that holds the currently selected task, that is handled by the implementation of this class

_taskEvent: TaskEventService
_taskOperations: TaskOperations
_taskResourceService: TaskResourceService
_translate: TranslateService
_updateSuccess$: Subject<boolean>
_userComparator: UserComparatorService

Accessors

Methods

  • Compares the values that are in the backend compatible format as given by the FieldConverterService and determines whether they are the same value, or not.

    Parameters

    • current: any

      the current value (can also be called value1 or left)

    • old: any

      the new value (can also be called value2 or right)

    Returns boolean

    true if the values are the same and false otherwise

  • Loads the Data Fields of an uninitialized Task from backend and populates the Task managed by TaskContentService with the appropriate objects.

    Beware that if the Task has some data already loaded this function does nothing and only passes true to the afterAction argument.

    If the task held within the TaskContentService changes before a response is received, the response will be ignored and the afterAction will not be executed.

    Parameters

    • afterAction: AfterAction = ...

      if the request completes successfully emits true into the Subject, otherwise false will be emitted

    • force: boolean = false

      set to true if you need force reload of all task data

    Returns void

  • Performs a setData request on the task currently stored in the taskContent service

    Parameters

    • setTaskId: string

      ID of the task

    • context: TaskSetDataRequestContext

      context of the setData request

    • afterAction: AfterAction

      the action that should be performed after the request is processed

    • nextEvent: AfterAction

      indicates to the event queue that the next event can be processed

    Returns void

  • Processes an erroneous outcome of a getData request

    Parameters

    • gottenTaskId: string

      the ID of the task whose data was requested

    • error: Error | HttpErrorResponse

      the returned error

    • afterAction: AfterAction

      the action that should be performed after the request is processed

    • nextEvent: AfterAction

      indicates to the event queue that the next event can be processed

    Returns void

  • Processes an erroneous outcome of a setData request

    Parameters

    • setTaskId: string

      the ID of the task whose data was set

    • error: HttpErrorResponse

      the returned error

    • afterAction: AfterAction

      the action that should be performed after the request is processed

    • nextEvent: AfterAction

      indicates to the event queue that the next event can be processed

    • context: TaskSetDataRequestContext

    Returns void

  • Processes a successful outcome of a getData request

    Parameters

    • gottenTaskId: string

      the ID of the task whose data was requested

    • dataGroups: DataGroup[]

      the returned data groups of the task

    • afterAction: AfterAction

      the action that should be performed after the request is processed

    • nextEvent: AfterAction

      indicates to the event queue that the next event can be processed

    Returns void

  • Processes a successful outcome of a setData request

    Parameters

    • setTaskId: string

      the ID of the task whose data was set

    • response: EventOutcomeMessageResource

      the resulting Event outcome of the set data request

    • afterAction: AfterAction

      the action that should be performed after the request is processed

    • nextEvent: AfterAction

      indicates to the event queue that the next event can be processed

    • context: TaskSetDataRequestContext

      hold the data that was sent in request

    Returns void

  • Collects all changed data fields and notifies the backend of the changes.

    If the request is successful clears the [changed]DataField#changed flag on all data fields that were a part of the request and emits a ChangedFields object into this object's [changedFields$]TaskDataService#changedFields$ stream.

    If the task held within the TaskContentService changes before a response is received, the response will be ignored and the afterAction will not be executed.

    Parameters

    • afterAction: AfterAction = ...

      if the request completes successfully emits true into the Subject, otherwise false will be emitted

    Returns void