mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2458] Updated doc to standard format (#3047)
This commit is contained in:
committed by
Eugenio Romano
parent
1fade9b23b
commit
499c3cd66e
@@ -34,6 +34,11 @@ export class ProcessService {
|
||||
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get process instances for a filter and optionally a process definition.
|
||||
* @param requestNode Filter for instances
|
||||
* @param processDefinitionKey Limits returned instances to a process definition
|
||||
*/
|
||||
getProcessInstances(requestNode: ProcessFilterParamRepresentationModel, processDefinitionKey?: string): Observable<ProcessListModel> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessInstances(requestNode))
|
||||
.map((res: any) => {
|
||||
@@ -48,8 +53,8 @@ export class ProcessService {
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch the Process Audit information as a pdf
|
||||
* @param processId - the process id
|
||||
* Fetches the Process Audit information as a pdf
|
||||
* @param processId ID of the target process
|
||||
*/
|
||||
fetchProcessAuditPdfById(processId: string): Observable<Blob> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessAuditPdf(processId))
|
||||
@@ -57,19 +62,28 @@ export class ProcessService {
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch the Process Audit information in a json format
|
||||
* @param processId - the process id
|
||||
* Fetches the Process Audit information in a json format.
|
||||
* @param processId ID of the target process
|
||||
*/
|
||||
fetchProcessAuditJsonById(processId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessAuditJson(processId))
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Process Instance metadata.
|
||||
* @param processInstanceId ID of the target process
|
||||
*/
|
||||
getProcess(processInstanceId: string): Observable<ProcessInstance> {
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.processApi.getProcessInstance(processInstanceId))
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets task instances for a process instance.
|
||||
* @param processInstanceId ID of the process instance
|
||||
* @param state Task state filter (can be "active" or "completed")
|
||||
*/
|
||||
getProcessTasks(processInstanceId: string, state?: string): Observable<TaskDetailsModel[]> {
|
||||
let taskOpts = state ? {
|
||||
processInstanceId: processInstanceId,
|
||||
@@ -86,6 +100,10 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets process definitions associated with an app.
|
||||
* @param appId ID of a target app
|
||||
*/
|
||||
getProcessDefinitions(appId?: number): Observable<ProcessDefinitionRepresentation[]> {
|
||||
let opts = appId ? {
|
||||
latest: true,
|
||||
@@ -101,6 +119,10 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the versions of process definitions associated with an app.
|
||||
* @param appId ID of a target app
|
||||
*/
|
||||
getProcessDefinitionVersions(appId?: number): Observable<ProcessDefinitionRepresentation[]> {
|
||||
const opts = appId ? { appDefinitionId: appId } : {};
|
||||
|
||||
@@ -112,6 +134,14 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a process based on a process definition, name, form values or variables.
|
||||
* @param processDefinitionId Process definition ID
|
||||
* @param name Process name
|
||||
* @param outcome Process outcome
|
||||
* @param startFormValues Values for the start form
|
||||
* @param variables Array of process instance variables
|
||||
*/
|
||||
startProcess(processDefinitionId: string, name: string, outcome?: string, startFormValues?: FormValues, variables?: ProcessInstanceVariable[]): Observable<ProcessInstance> {
|
||||
let startRequest: any = {
|
||||
name: name,
|
||||
@@ -133,6 +163,10 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a process instance.
|
||||
* @param processInstanceId ID of process to cancel
|
||||
*/
|
||||
cancelProcess(processInstanceId: string): Observable<void> {
|
||||
return Observable.fromPromise(
|
||||
this.alfrescoApiService.getInstance().activiti.processApi.deleteProcessInstance(processInstanceId)
|
||||
@@ -140,6 +174,10 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the variables for a process instance.
|
||||
* @param processInstanceId ID of the target process
|
||||
*/
|
||||
getProcessInstanceVariables(processInstanceId: string): Observable<ProcessInstanceVariable[]> {
|
||||
return Observable.fromPromise(
|
||||
this.alfrescoApiService.getInstance().activiti.processInstanceVariablesApi.getProcessInstanceVariables(processInstanceId)
|
||||
@@ -148,6 +186,11 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates variables for a process instance.
|
||||
* @param processInstanceId ID of the target process
|
||||
* @param variables Variables to update
|
||||
*/
|
||||
createOrUpdateProcessInstanceVariables(processInstanceId: string, variables: ProcessInstanceVariable[]): Observable<ProcessInstanceVariable[]> {
|
||||
return Observable.fromPromise(
|
||||
this.alfrescoApiService.getInstance().activiti.processInstanceVariablesApi.createOrUpdateProcessInstanceVariables(processInstanceId, variables)
|
||||
@@ -155,6 +198,11 @@ export class ProcessService {
|
||||
.catch(err => this.handleProcessError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a variable for a process instance.
|
||||
* @param processInstanceId ID of the target process
|
||||
* @param variableName Name of the variable to delete
|
||||
*/
|
||||
deleteProcessInstanceVariable(processInstanceId: string, variableName: string): Observable<void> {
|
||||
return Observable.fromPromise(
|
||||
this.alfrescoApiService.getInstance().activiti.processInstanceVariablesApi.deleteProcessInstanceVariable(processInstanceId, variableName)
|
||||
|
Reference in New Issue
Block a user