[ADF-3745] Added docs for new PS cloud services (#4129)

This commit is contained in:
Andy Stark
2019-01-09 17:27:26 +00:00
committed by Eugenio Romano
parent 968c65ff70
commit aee34184ca
9 changed files with 270 additions and 63 deletions

View File

@@ -40,8 +40,8 @@ export class StartProcessCloudService {
}
/**
* Gets process definitions associated with an app.
* @param appId ID of a target app
* Gets the process definitions associated with an app.
* @param appName Name of the target app
* @returns Array of process definitions
*/
getProcessDefinitions(appName: string): Observable<ProcessDefinitionCloud[]> {
@@ -70,11 +70,7 @@ export class StartProcessCloudService {
/**
* Starts a process based on a process definition, name, form values or variables.
* @param appName name of the Application
* @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
* @param requestPayload Details of the process (definition key, name, variables, etc)
* @returns Details of the process instance just started
*/
startProcess(appName: string, requestPayload: ProcessPayloadCloud): Observable<ProcessInstanceCloud> {

View File

@@ -35,6 +35,11 @@ export class StartTaskCloudService {
private logService: LogService
) {}
/**
* Creates a new standalone task.
* @param taskDetails Details of the task to create
* @returns Details of the newly created task
*/
createNewTask(taskDetails: TaskDetailsCloudModel): Observable<TaskDetailsCloudModel> {
let queryUrl = this.buildCreateTaskUrl(taskDetails.appName);
const bodyParam = JSON.stringify(this.buildRequestBody(taskDetails));

View File

@@ -61,6 +61,12 @@ export class TaskFilterCloudService {
return this.filters$;
}
/**
* Gets a task filter.
* @param appName Name of the target app
* @param id ID of the task
* @returns Details of the task filter
*/
getTaskFilterById(appName: string, id: string): TaskFilterCloudModel {
const username = this.getUsername();
let key = `task-filters-${appName}-${username}`;
@@ -70,7 +76,7 @@ export class TaskFilterCloudService {
}
/**
* Adds a new task filter
* Adds a new task filter.
* @param filter The new filter to add
* @returns Details of task filter just added
*/
@@ -91,8 +97,8 @@ export class TaskFilterCloudService {
}
/**
* Update task filter
* @param filter The new filter to update
* Updates a task filter.
* @param filter The filter to update
*/
updateFilter(filter: TaskFilterCloudModel) {
const username = this.getUsername();
@@ -107,8 +113,8 @@ export class TaskFilterCloudService {
}
/**
* Delete task filter
* @param filter The new filter to delete
* Deletes a task filter
* @param filter The filter to delete
*/
deleteFilter(filter: TaskFilterCloudModel) {
const username = this.getUsername();
@@ -125,10 +131,19 @@ export class TaskFilterCloudService {
}
}
/**
* Gets the username field from the access token.
* @returns Username string
*/
getUsername(): string {
return this.getValueFromToken<string>('preferred_username');
}
/**
* Gets a named value from the access token.
* @param key Key name of the value
* @returns The value data
*/
getValueFromToken<T>(key: string): T {
let value;
const token = localStorage.getItem('access_token');