@netgrif/components-core
Version:
Netgrif Application engine frontend core Angular library
76 lines (75 loc) • 4.98 kB
TypeScript
import { LoggerService } from '../../logger/services/logger.service';
import { SideMenuService } from '../../side-menu/services/side-menu.service';
import { TaskResourceService } from '../../resources/engine-endpoint/task-resource.service';
import { TaskContentService } from '../../task-content/services/task-content.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 { 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 * as i0 from "@angular/core";
/**
* Service that handles the logic of delegating a task.
*/
export declare class DelegateTaskService extends TaskHandlingService {
protected _log: LoggerService;
protected _sideMenuService: SideMenuService;
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 _taskOperations: TaskOperations;
protected _userAssignComponent: any;
constructor(_log: LoggerService, _sideMenuService: SideMenuService, _taskResourceService: TaskResourceService, _snackBar: SnackBarService, _translate: TranslateService, _taskState: TaskRequestStateService, _taskEvent: TaskEventService, _taskDataService: TaskDataService, _eventQueue: EventQueueService, _eventService: EventService, _changedFieldsService: ChangedFieldsService, _taskOperations: TaskOperations, _userAssignComponent: any, _selectedCaseService: SelectedCaseService, _taskContentService: TaskContentService);
/**
* Performs the 'delegate' 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 delegate 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 delegate completes successfully `true` will be emitted into this Subject, otherwise `false` will be emitted
*/
delegate(afterAction?: AfterAction): void;
/**
* Performs a `delegate` request on the task currently stored in the `taskContent` service
* @param afterAction the action that should be performed after the request is processed
* @param delegatedTaskId id of the task that is being delegated
* @param delegatedUserId id of the user whom the task is being delegated
* @param nextEvent indicates to the event queue that the next event can be processed
*/
protected performDelegateRequest(afterAction: AfterAction, delegatedTaskId: string, delegatedUserId: any, nextEvent: AfterAction): void;
/**
* Reloads the task and emits `true` to the `afterAction` stream
*/
protected completeSuccess(afterAction: AfterAction, nextEvent: AfterAction, outcome?: TaskEventOutcome): void;
/**
* Completes all the action streams and sends the notification, with the provided result
*/
protected completeActions(afterAction: AfterAction, nextEvent: AfterAction, result: boolean, outcome?: TaskEventOutcome): void;
/**
* Publishes a delegate notification to the {@link TaskEventService}
* @param success whether the delegate operation was successful or not
* @param outcome
*/
protected sendNotification(success: boolean, outcome?: TaskEventOutcome): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DelegateTaskService, [null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, null]>;
static ɵprov: i0.ɵɵInjectableDeclaration<DelegateTaskService>;
}