UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

86 lines (85 loc) 5.65 kB
import { LoggerService } from '../../logger/services/logger.service'; import { TaskContentService } from '../../task-content/services/task-content.service'; import { TaskResourceService } from '../../resources/engine-endpoint/task-resource.service'; import { SnackBarService } from '../../snack-bar/services/snack-bar.service'; import { TranslateService } from '@ngx-translate/core'; import { TaskRequestStateService } from './task-request-state.service'; import { TaskHandlingService } from './task-handling-service'; import { TaskOperations } from '../interfaces/task-operations'; import { SelectedCaseService } from './selected-case.service'; import { TaskEventService } from '../../task-content/services/task-event.service'; import { TaskDataService } from './task-data.service'; import { TaskViewService } from '../../view/task-view/service/task-view.service'; import { EventQueueService } from '../../event-queue/services/event-queue.service'; import { AfterAction } from '../../utility/call-chain/after-action'; import { ChangedFieldsService } from '../../changed-fields/services/changed-fields.service'; import { EventService } from '../../event/services/event.service'; import { TaskEventOutcome } from '../../event/model/event-outcomes/task-outcomes/task-event-outcome'; import { FrontActionService } from '../../actions/services/front-action.service'; import * as i0 from "@angular/core"; /** * Service that handles the logic of assigning a task. */ export declare class AssignTaskService extends TaskHandlingService { protected _log: LoggerService; protected _taskResourceService: TaskResourceService; protected _snackBar: SnackBarService; protected _translate: TranslateService; protected _taskState: TaskRequestStateService; protected _taskEvent: TaskEventService; protected _taskDataService: TaskDataService; protected _eventQueue: EventQueueService; protected _eventService: EventService; protected _changedFieldsService: ChangedFieldsService; protected _frontActionService: FrontActionService; protected _taskOperations: TaskOperations; protected _taskViewService: TaskViewService; constructor(_log: LoggerService, _taskResourceService: TaskResourceService, _snackBar: SnackBarService, _translate: TranslateService, _taskState: TaskRequestStateService, _taskEvent: TaskEventService, _taskDataService: TaskDataService, _eventQueue: EventQueueService, _eventService: EventService, _changedFieldsService: ChangedFieldsService, _frontActionService: FrontActionService, _taskOperations: TaskOperations, _selectedCaseService: SelectedCaseService, _taskViewService: TaskViewService, _taskContentService: TaskContentService); /** * Performs the 'assign' operation on the task held by {@link TaskContentService}. * * Doesn't send any requests if the loading indicator is in it's active state. * Otherwise sets the indicator to the active state and disables it once the request response is received. * * The argument can be used to chain operations together, * or to execute code conditionally based on the success state of the assign operation. * * If the task held within the {@link TaskContentService} changes before a response is received, the response will be ignored * and the `afterAction` will not be executed. * @param afterAction if assign completes successfully `true` will be emitted into this Subject, otherwise `false` will be emitted */ assign(afterAction?: AfterAction): void; /** * Performs an `assign` request on the task currently stored in the `taskContent` service * @param afterAction the action that should be performed after the request is processed * @param nextEvent indicates to the event queue that the next event can be processed * @param forceReload whether a force reload of the task data should be performed after assign. * If set to `false` a regular reload is performed instead. */ protected performAssignRequest(afterAction: AfterAction, nextEvent: AfterAction, forceReload: boolean): void; /** * Calls the endpoint and processes the possible responses. * @param afterAction the action that should be performed after the request is processed * @param assignedTaskId the id of the task that is being assigned * @param nextEvent indicates to the event queue that the next event can be processed * @param forceReload whether a force reload of the task data should be performed after assign. * If set to `false` a regular reload is performed instead. */ protected assignRequest(afterAction: AfterAction, assignedTaskId: string, nextEvent: AfterAction, forceReload: boolean): void; /** * Reloads the task and emits `true` to the `afterAction` stream */ protected completeSuccess(afterAction: AfterAction, nextEvent: AfterAction): void; /** * complete all action streams and send notification with selected boolean */ protected completeActions(afterAction: AfterAction, nextEvent: AfterAction, bool: boolean, outcome?: TaskEventOutcome): void; /** * Publishes an assign notification to the {@link TaskEventService} * @param success whether the assign operation was successful or not * @param outcome */ protected sendNotification(success: boolean, outcome?: TaskEventOutcome): void; static ɵfac: i0.ɵɵFactoryDeclaration<AssignTaskService, [null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null]>; static ɵprov: i0.ɵɵInjectableDeclaration<AssignTaskService>; }