[ACS-7427] Process Services improvements and cleanup (#9664)

This commit is contained in:
Denys Vuika
2024-05-20 16:08:47 -04:00
committed by GitHub
parent 96e607b4de
commit e71e2a749a
174 changed files with 1736 additions and 3933 deletions

View File

@@ -163,29 +163,27 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Bpm User model](core/models/bpm-user.model.md) | Contains information about a Process Services user. | [Source](../lib/process-services/src/lib/common/models/bpm-user.model.ts) |
| [Ecm User model](core/models/ecm-user.model.md) | Contains information about a Content Services user. | [Source](../lib/content-services/src/lib/common/models/ecm-user.model.ts) |
| [Form Field model](core/models/form-field.model.md) | Contains the value and metadata for a field of a Form component. | [Source](../lib/core/src/lib/form/components/widgets/core/form-field.model.ts) |
| [Product Version model](core/models/product-version.model.md) | Contains version and license information classes for Alfresco products. | [Source](../lib/core/src/lib/models/product-version.model.ts) |
| [User Process model](core/models/user-process.model.md) | Represents a Process Services user. | [Source](../lib/process-services/src/lib/common/models/user-process.model.ts) |
### Pipes
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [App Config Pipe](core/pipes/app-config.pipe.md) | Retrieves values from the application configuration file directly. | [Source](../lib/core/src/lib/app-config/app-config.pipe.ts) |
| [Decimal Number Pipe](core/pipes/decimal-number.pipe.md) | Transforms a number to have a certain amount of digits in its integer part and also in its decimal part. | [Source](../lib/core/src/lib/pipes/decimal-number.pipe.ts) |
| [File Size pipe](core/pipes/file-size.pipe.md) | Converts a number of bytes to the equivalent in KB, MB, etc. | [Source](../lib/core/src/lib/pipes/file-size.pipe.ts) |
| [Format Space pipe](core/pipes/format-space.pipe.md) | Replaces all the white space in a string with a supplied character. | [Source](../lib/core/src/lib/pipes/format-space.pipe.ts) |
| [Full name pipe](core/pipes/full-name.pipe.md) | Joins the first and last name properties from a UserProcessModel object into a single string. | [Source](../lib/core/src/lib/pipes/full-name.pipe.ts) |
| [Localized Date pipe](core/pipes/localized-date.pipe.md) | Converts a date to a given format and locale. | [Source](../lib/core/src/lib/pipes/localized-date.pipe.ts) |
| [Mime Type Icon pipe](core/pipes/mime-type-icon.pipe.md) | Retrieves an icon to represent a MIME type. | [Source](../lib/core/src/lib/pipes/mime-type-icon.pipe.ts) |
| Name | Description | Source link |
| ---- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
| [App Config Pipe](core/pipes/app-config.pipe.md) | Retrieves values from the application configuration file directly. | [Source](../lib/core/src/lib/app-config/app-config.pipe.ts) |
| [Decimal Number Pipe](core/pipes/decimal-number.pipe.md) | Transforms a number to have a certain amount of digits in its integer part and also in its decimal part. | [Source](../lib/core/src/lib/pipes/decimal-number.pipe.ts) |
| [File Size pipe](core/pipes/file-size.pipe.md) | Converts a number of bytes to the equivalent in KB, MB, etc. | [Source](../lib/core/src/lib/pipes/file-size.pipe.ts) |
| [Format Space pipe](core/pipes/format-space.pipe.md) | Replaces all the white space in a string with a supplied character. | [Source](../lib/core/src/lib/pipes/format-space.pipe.ts) |
| [Full name pipe](core/pipes/full-name.pipe.md) | Joins the first and last name properties from a `UserLike` object into a single string. | [Source](../lib/core/src/lib/pipes/full-name.pipe.ts) |
| [Localized Date pipe](core/pipes/localized-date.pipe.md) | Converts a date to a given format and locale. | [Source](../lib/core/src/lib/pipes/localized-date.pipe.ts) |
| [Mime Type Icon pipe](core/pipes/mime-type-icon.pipe.md) | Retrieves an icon to represent a MIME type. | [Source](../lib/core/src/lib/pipes/mime-type-icon.pipe.ts) |
| [Multi Value Pipe](core/pipes/multi-value.pipe.md) | Takes an array of strings and turns it into one string where items are separated by a separator. The default separator applied to the list is the comma , however, you can set your own separator in the params of the pipe. | [Source](../lib/core/src/lib/pipes/multi-value.pipe.ts) |
| [Node Name Tooltip pipe](core/pipes/node-name-tooltip.pipe.md) | Formats the tooltip for a Node. | [Source](../lib/content-services/src/lib/pipes/node-name-tooltip.pipe.ts) |
| [Text Highlight pipe](core/pipes/text-highlight.pipe.md) | Adds highlighting to words or sections of text that match a search string. | [Source](../lib/core/src/lib/pipes/text-highlight.pipe.ts) |
| [Time Ago pipe](core/pipes/time-ago.pipe.md) | Converts a recent past date into a number of days ago. | [Source](../lib/core/src/lib/pipes/time-ago.pipe.ts) |
| [User Initial pipe](core/pipes/user-initial.pipe.md) | Takes the name fields of a UserProcessModel object and extracts and formats the initials. | [Source](../lib/core/src/lib/pipes/user-initial.pipe.ts) |
| [Date Time pipe](core/pipes/date-time.pipe.md) | Converts a given input value into a Date object and adjusts it according to the specified format and timezone offset. | [Source](../lib/core/src/lib/pipes/date-time.pipe.ts) |
| [Node Name Tooltip pipe](core/pipes/node-name-tooltip.pipe.md) | Formats the tooltip for a Node. | [Source](../lib/content-services/src/lib/pipes/node-name-tooltip.pipe.ts) |
| [Text Highlight pipe](core/pipes/text-highlight.pipe.md) | Adds highlighting to words or sections of text that match a search string. | [Source](../lib/core/src/lib/pipes/text-highlight.pipe.ts) |
| [Time Ago pipe](core/pipes/time-ago.pipe.md) | Converts a recent past date into a number of days ago. | [Source](../lib/core/src/lib/pipes/time-ago.pipe.ts) |
| [User Initial pipe](core/pipes/user-initial.pipe.md) | Takes the name fields of a `UserLike` object and extracts and formats the initials. | [Source](../lib/core/src/lib/pipes/user-initial.pipe.ts) |
| [Date Time pipe](core/pipes/date-time.pipe.md) | Converts a given input value into a Date object and adjusts it according to the specified format and timezone offset. | [Source](../lib/core/src/lib/pipes/date-time.pipe.ts) |
### Services

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-02-08
---
# [Row Filter Model](../../../lib/content-services/document-list/data/row-filter.model.ts "Defined in row-filter.model.ts")
# Row Filter Model
Defines the Row Filter function used by the [Document List Component](../components/document-list.component.md).

View File

@@ -2,22 +2,16 @@
Title: Content Comment List Service
Added: v6.0.0
Status: Active
Last reviewed: 2023-01-17
Last reviewed: 2024-05-14
---
# [Content Comment List service](../../../lib/content-services/src/lib/node-comments/services/content-comment-list.service.ts "Defined in content-comment-list.service.ts")
# Content Comment List Service
Gets user image for comments in Content Services.
## Class members
## API
### Methods
- **getUserImage**(user: `string`): `string`<br/>
- **getUserImage**(userId: `string`): `string`<br/>
Gets user image
- _user:_ `string` - The user id;
- **Returns** `string` - The user image path
## See also
- [Node comments component](../../../lib/content-services/src/lib/node-comments/node-comments.component.ts)

View File

@@ -5,13 +5,11 @@ Status: Active
Last reviewed: 2022-12-19
---
# [Node Comments service](../../../lib/content-services/src/lib/node-comments/services/node-comments.service.ts "Defined in node-comments.service.ts")
# Node Comments Service
Adds and retrieves comments for nodes in Content Services.
## Class members
### Methods
## API
- **add**(id: `string`, message: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`CommentModel`](../../../lib/core/src/lib/models/comment.model.ts)`>`<br/>
Adds a comment to a task.
@@ -23,10 +21,6 @@ Adds and retrieves comments for nodes in Content Services.
- _id:_ `string` - ID of the target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`CommentModel`](../../../lib/core/src/lib/models/comment.model.ts)`[]>` - Details for each comment
- **getUserImage**(avatarId: `string`): `string`<br/>
- _avatarId:_ `string` -
- **Returns** `string` -
## See also
- [Node comments component](../../../lib/content-services/src/lib/node-comments/node-comments.component.ts)
Gets the URL for the user's profile image.
- _avatarId:_ `string` - ID of the user
- **Returns** `string` - URL for the user's profile image

View File

@@ -5,13 +5,11 @@ Status: Active
Last reviewed: 2022-12-19
---
# [Task Comments service](../../../lib/process-services/src/lib/task-comments/services/task-comments.service.ts "Defined in task-comments.service.ts")
# Task Comments Service
Adds and retrieves comments for task and process instances in Process Services.
## Class members
### Methods
## API
- **add**(id: `string`, message: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`CommentModel`](../../../lib/core/src/lib/models/comment.model.ts)`>`<br/>
Adds a comment to a task.
@@ -22,11 +20,7 @@ Adds and retrieves comments for task and process instances in Process Services.
Gets all comments that have been added to a task.
- _id:_ `string` - ID of the target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`CommentModel`](../../../lib/core/src/lib/models/comment.model.ts)`[]>` - Details for each comment
- **getUserImage**(user: [`UserProcessModel`](../../core/models/user-process.model.md)): `string`<br/>
- _user:_ [`UserProcessModel`](../../core/models/user-process.model.md) -
- **Returns** `string` -
## See also
- [Task comments component](../../../lib/process-services/src/lib/task-comments/task-comments.component.ts)
- **getUserImage**(userId: `string`): `string`<br/>
Gets the URL for the user's profile image.
- _userId:_ `string` - ID of the user
- **Returns** `string` - URL for the user's profile image

View File

@@ -1,27 +0,0 @@
---
Title: Bpm User model
Added: v2.0.0
Status: Active
---
# [Bpm User model](../../../lib/process-services/src/lib/common/models/bpm-user.model.ts "Defined in bpm-user.model.ts")
Contains information about a Process Services user.
## Details
Instances of this class are returned by the methods of the
[Bpm User service](../services/bpm-user.service.md). It implements the
[`UserRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/UserRepresentation.md) interface, which is defined in the
[Alfresco JS API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/UserRepresentation.md).
Note that the Typescript class for this model is in active development;
it is likely to change and so its properties are not listed here. For the
latest version of the class, see the
[source file](https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/userinfo/models/bpm-user.model.ts).
## See also
- [Bpm user service](../services/bpm-user.service.md)
- [Ecm user model](ecm-user.model.md)
- [People process service](../services/people-process.service.md)

View File

@@ -24,4 +24,3 @@ latest version of the class, see the
- [Ecm user service](../services/ecm-user.service.md)
- [People content service](../services/people-content.service.md)
- [Bpm user model](bpm-user.model.md)

View File

@@ -1,24 +0,0 @@
---
Title: User Process model
Added: v2.0.0
Status: Active
---
# [User Process model](../../../lib/process-services/src/lib/common/models/user-process.model.ts "Defined in user-process.model.ts")
Represents a Process Services user.
## Details
This class contains basic information about a Process Services user and
is used throughout ADF to identify and list users (eg, to assign them to
a task or to list them in search results).
Note that the Typescript class for this model is in active development;
it is likely to change and so its properties are not listed here. For the
latest version of the class, see the
[source file](https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/core/models/user-process.model.ts).
## See also
- [People process service](../services/people-process.service.md)

View File

@@ -5,9 +5,9 @@ Status: Active
Last reviewed: 2018-11-12
---
# [Full name pipe](../../../lib/core/src/lib/pipes/full-name.pipe.ts "Defined in full-name.pipe.ts")
# Full Name Pipe
Joins the first and last name properties from a [`UserProcessModel`](../../core/models/user-process.model.md) object into a single string.
Joins the first and last name properties from the `UserLike` object into a single string.
## Basic Usage
@@ -23,7 +23,7 @@ Joins the first and last name properties from a [`UserProcessModel`](../../core/
## Details
The pipe offers a convenient way to extract the name from a [User process model](../models/user-process.model.md) object.
The pipe offers a convenient way to extract the name from a `UserLike` object.
## See also

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2018-11-19
---
# [Time Ago pipe](../../../lib/core/src/lib/pipes/time-ago.pipe.ts "Defined in time-ago.pipe.ts")
# Time Ago Pipe
Converts a recent past date into a number of days ago.
@@ -21,14 +21,14 @@ Converts a recent past date into a number of days ago.
<!-- {% endraw %} -->
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| locale | string | 'en-US' | A locale id for the locale format rules to use. |
| Name | Type | Default value | Description |
|--------|--------|---------------|-------------------------------------------------|
| locale | string | 'en-US' | A locale id for the locale format rules to use. |
## Details
The pipe finds the difference between the input date and the current date. If it
is less than seven days then then the date will be formatted as "X days ago".
is less than seven days then the date will be formatted as "X days ago".
Otherwise, the usual full date format is used.
By default, it localizes the date to the language that is currently in use by the app. Furthermore, a different locale id can be passed to the pipe to overwrite the locale id to set a custom one.

View File

@@ -5,9 +5,9 @@ Status: Active
Last reviewed: 2018-11-12
---
# [User Initial pipe](../../../lib/core/src/lib/pipes/user-initial.pipe.ts "Defined in user-initial.pipe.ts")
# User Initials Pipe
Takes the name fields of a [`UserProcessModel`](../../core/models/user-process.model.md) object and extracts and formats the initials.
Takes the name fields of a `UserLike` object and extracts and formats the initials.
## Basic Usage

View File

@@ -13,10 +13,6 @@ Gets details of the Process Services apps that are deployed for the user.
### Methods
- **getApplicationDetailsById**(appId: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AppDefinitionRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppDefinitionRepresentation.md)`>`<br/>
Gets the details for a specific app ID number.
- _appId:_ `number` - ID of the target app
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AppDefinitionRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppDefinitionRepresentation.md)`>` - Details of the app
- **getDeployedApplications**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AppDefinitionRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppDefinitionRepresentation.md)`[]>`<br/>
Gets a list of deployed apps for this user.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AppDefinitionRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppDefinitionRepresentation.md)`[]>` - The list of deployed apps

View File

@@ -13,18 +13,15 @@ Gets information about the current Process Services user.
### Methods
- **getCurrentUserInfo**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`BpmUserModel`](../../core/models/bpm-user.model.md)`>`<br/>
- **getCurrentUserInfo**(): `Observable<UserRepresentation>`<br/>
Gets information about the current user.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`BpmUserModel`](../../core/models/bpm-user.model.md)`>` - User information object
- **Returns** [`Observable`<UserRepresentation>` - User information object
- **getCurrentUserProfileImage**(): `string`<br/>
Gets the current user's profile image as a URL.
- **Returns** `string` - URL string
## Details
The class returned by `getCurrentUserInfo` is detailed
in the [Bpm User model docs](../models/bpm-user.model.md).
See the
[getProfile](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/ProfileApi.md#getProfile)
and
@@ -34,4 +31,3 @@ methods in the Alfresco JS API for more information about the REST calls used by
## See also
- [Ecm user service](../services/ecm-user.service.md)
- [Bpm user model](../models/bpm-user.model.md)

View File

@@ -5,13 +5,11 @@ Status: Active
Last reviewed: 2018-11-14
---
# [Comment Process service](../../../lib/process-services/src/lib/process-comments/services/comment-process.service.ts "Defined in comment-process.service.ts")
# Comment Process Service
Adds and retrieves comments for task and process instances in Process Services.
## Class members
### Methods
## API
- **add**(id: `string`, message: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`CommentModel`](../../../lib/core/src/lib/models/comment.model.ts)`>`<br/>
Adds a comment to a process instance.
@@ -22,13 +20,7 @@ Adds and retrieves comments for task and process instances in Process Services.
Gets all comments that have been added to a process instance.
- _id:_ `string` -
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`CommentModel`](../../../lib/core/src/lib/models/comment.model.ts)`[]>` - Details for each comment
- **getUserImage**(user: `any`): `string`<br/>
- _user:_ `any` -
- **Returns** `string` -
## Details
See the Comments API section of the
[Alfresco JS API docs](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api)
for further details about the underlying REST API.
- **getUserImage**(userId: `string`): `string`<br/>
Gets the URL for the user image.
- _userId:_ `string` -
- **Returns** `string` - URL for the user image

View File

@@ -4,7 +4,7 @@ Added: v2.0.0
Status: Active
---
# [Form service](../../../lib/core/src/lib/form/services/form.service.ts "Defined in form.service.ts")
# Form Service
Implements Process Services form methods
@@ -13,11 +13,9 @@ Implements Process Services form methods
```ts
import { FormService, FormEvent, FormFieldEvent } from '@alfresco/adf-core';
@Component(...)
@Component()
class MyComponent {
constructor(formService: FormService) {
formService.formLoaded.subscribe(
(e: FormEvent) => {
console.log(`Form loaded: ${e.form.id}`);
@@ -29,9 +27,7 @@ class MyComponent {
console.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`);
}
);
}
}
```
@@ -173,33 +169,25 @@ class MyComponent {
- `userId` - ID of the target user
- [`getWorkflowUsers(filter: string, groupId?: string): Observable<UserProcessModel[]>`](../../core/models/user-process.model.md)
- `getWorkflowUsers(filter: string, groupId?: string): Observable<LightUserRepresentation[]>`
Gets a list of workflow users.
- `filter` - Filter to select specific users
- `groupId` - (Optional) Group ID for the search
- [`getWorkflowGroups(filter: string, groupId?: string): Observable<GroupModel[]>`](../../../lib/core/src/lib/form/components/widgets/core/group.model.ts)
Gets a list of groups in a workflow.
- `getWorkflowGroups(filter: string, groupId?: string): Observable<GroupModel[]>`
Gets a list of groups in a workflow.
- `filter` - Filter to select specific groups
- `groupId` - (Optional) Group ID for the search
- `getFormId(res: any): string`
Gets the ID of a form.
Gets the ID of a form.
- `res` - Object representing a form
- `toJson(res: any): any`
Creates a JSON representation of form data.
Creates a JSON representation of form data.
- `res` - Object representing form data
- `toJsonArray(res: any): any`
Creates a JSON array representation of form data.
Creates a JSON array representation of form data.
- `res` - Object representing form data
- `handleError(error: any):`[`Observable`](http://reactivex.io/documentation/observable.html)`<any>`
Reports an error message.
- `error` - Data object with optional \`message\` and \`status\` fields for the error

View File

@@ -2,69 +2,47 @@
Title: People Process service
Added: v2.0.0
Status: Active
Last reviewed: 2018-04-05
Last reviewed: 2024-05-14
---
# [People Process service](../../../lib/process-services/src/lib/common/services/people-process.service.ts "Defined in people-process.service.ts")
# People Process Service
Gets information about Process Services users.
## Class members
## API
### Methods
- **getCurrentUserInfo**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`BpmUserModel`](../../core/models/bpm-user.model.md)`>`<br/>
- **getCurrentUserInfo**(): `Observable<UserRepresentation>`<br/>
Gets information about the current user.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`BpmUserModel`](../../core/models/bpm-user.model.md)`>` - User information object
- **Returns** `Observable<UserRepresentation>` - User information object
- **getCurrentUserProfileImage**(): `string`<br/>
Gets the current user's profile image as a URL.
- **Returns** `string` - URL string
- **getUserImage**(user: [`UserProcessModel`](../../core/models/user-process.model.md)): `string`<br/>
Gets the profile picture URL for the specified user.
- _user:_ [`UserProcessModel`](../../core/models/user-process.model.md) - The target user
- **Returns** `string` - Profile picture URL
- **getUserImage**(userId: string): `string`<br/>
Gets a user's profile image as a URL.
- _userId:_ `string` - User ID
- **Returns** `string` - URL string
- **getWorkflowGroups**(filter: `string`, groupId?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`GroupModel`](../../../lib/core/src/lib/form/components/widgets/core/group.model.ts)`[]>`<br/>
Gets a list of groups in a workflow.
- _filter:_ `string` - Filter to select specific groups
- _groupId:_ `string` - (Optional) Group ID for the search
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`GroupModel`](../../../lib/core/src/lib/form/components/widgets/core/group.model.ts)`[]>` - Array of groups
- **getWorkflowUsers**(taskId?: `string`, searchWord?: `string`, groupId?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>`<br/>
- **getWorkflowUsers**(taskId?: `string`, searchWord?: `string`, groupId?: `string`): `Observable<LightUserRepresentation[]>`<br/>
Gets information about users across all tasks.
- _taskId:_ `string` - (Optional) ID of the task
- _searchWord:_ `string` - (Optional) Filter text to search for
- _groupId:_ `string` - (Optional)
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>` - Array of user information objects
- **involveUserWithTask**(taskId: `string`, idToInvolve: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>`<br/>
- **Returns** `Observable<LightUserRepresentation[]>` - Array of user information objects
- **involveUserWithTask**(taskId: `string`, idToInvolve: `string`): `Observable<LightUserRepresentation[]>`<br/>
Sets a user to be involved with a task.
- _taskId:_ `string` - ID of the target task
- _idToInvolve:_ `string` - ID of the user to involve
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>` - Empty response when the update completes
- **removeInvolvedUser**(taskId: `string`, idToRemove: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>`<br/>
- **Returns** `Observable<LightUserRepresentation>` - Empty response when the update completes
- **removeInvolvedUser**(taskId: `string`, idToRemove: `string`): `Observable<LightUserRepresentation[]>`<br/>
Removes a user who is currently involved with a task.
- _taskId:_ `string` - ID of the target task
- _idToRemove:_ `string` - ID of the user to remove
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>` - Empty response when the update completes
## Details
Use `getWorkflowUsers` to find users across all tasks, optionally filtering by the `searchWord`
in the task name. The `taskId` parameter, if used, specifies a task to be _excluded_ from the
results. You would typically use this feature to find new users to assign to a task, in which
case you would want to exclude users already assigned to that task.
The [User Process model](../models/user-process.model.md) class used by the methods is seen throughout
ADF's Process Services features. Note that for `involveUserWithTask` and `removeInvolvedUser`,
null data is returned rather than usable details about users.
You can find more information about the REST API methods used by this service in the
[Task Actions API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/TaskActionsApi.md#involveUser)
(for `involveUserWithTask` and `removeInvolvedUser`), the
[User Workflow API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/UsersWorkflowApi.md#getUsers)
(for `getWorkflowUsers`) and the
[User API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/UserApi.md#getuserprofilepictureurl)(for `getUserImage`).
- **Returns** `Observable<LightUserRepresentation>` - Empty response when the update completes
## See also
- [User process model](../models/user-process.model.md)
- [Bpm user model](../models/bpm-user.model.md)
- [People content service](people-content.service.md)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 MiB

View File

@@ -41,27 +41,27 @@ Edits task filter details.
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| actions | `string[]` | | List of task filter actions. |
| appName | `string` | "" | (required) Name of the app. |
| environmentList | [`Environment`](../../../lib/process-services-cloud/src/lib/common/interface/environment.interface.ts)`[]` | \[] | List of environments. |
| filterProperties | `string[]` | \[] | List of task filter properties to display. |
| id | `string` | | (required) ID of the task filter. |
| processInstanceId | `string` | | processInstanceId of the task filter. |
| role | `string` | "" | user role. |
| showFilterActions | `boolean` | true | Toggles the filter actions. |
| showTaskFilterName | `boolean` | true | Toggles display of task filter name |
| showTitle | `boolean` | true | Toggles the title. |
| sortProperties | `string[]` | \[] | List of sort properties to display. |
| taskFilter | [`TaskFilterCloudModel`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts) | | Task Filter to use. |
| Name | Type | Default value | Description |
|--------------------|----------------------------------------------------------------------------------------------------------------------|---------------|--------------------------------------------|
| actions | `string[]` | | List of task filter actions. |
| appName | `string` | "" | (required) Name of the app. |
| environmentList | [`Environment`](../../../lib/process-services-cloud/src/lib/common/interface/environment.interface.ts)`[]` | \[] | List of environments. |
| filterProperties | `string[]` | \[] | List of task filter properties to display. |
| id | `string` | | (required) ID of the task filter. |
| processInstanceId | `string` | | processInstanceId of the task filter. |
| role | `string` | "" | user role. |
| showFilterActions | `boolean` | true | Toggles the filter actions. |
| showTaskFilterName | `boolean` | true | Toggles display of task filter name |
| showTitle | `boolean` | true | Toggles the title. |
| sortProperties | `string[]` | \[] | List of sort properties to display. |
| taskFilter | [`TaskFilterCloudModel`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts) | | Task Filter to use. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| action | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`TaskFilterAction`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts)`>` | Emitted when a filter action occurs (i.e Save, Save As, Delete). |
| filterChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<>` | Emitted when a task filter property changes. |
| Name | Type | Description |
|--------------|----------------------------------|------------------------------------------------------------------|
| action | `EventEmitter<TaskFilterAction>` | Emitted when a filter action occurs (i.e Save, Save As, Delete). |
| filterChange | `EventEmitter<any>` | Emitted when a task filter property changes. |
## Details
@@ -82,23 +82,23 @@ You can supply various _filter properties_ to edit that will determine
which tasks are found by a filter. The full set of properties is
given below:
| Name | Description |
| ---- | ----------- |
| **_appName_** | Name of the app |
| **_status_** | Execution state of the task. |
| **_assignee_** | [`User`](lib/core/src/lib/pipes/user-initial.pipe.ts) the task is assigned to |
| **_taskName_** | Name of the task |
| **_taskId_** | ID of the task |
| **_parentTaskId_** | ID of the task's parent task |
| **_priority_** | Task priority |
| **_createdDate_** | Date the task was created |
| **_standalone_** | Standalone status of the task |
| **_owner_** | [`User`](lib/core/src/lib/pipes/user-initial.pipe.ts) ID of the task's owner |
| **_processDefinitionId_** | Process definition ID |
| **_processInstanceId_** | Process instance ID |
| **_lastModified_** | Date the task was last modified. If lastModified defined the component will show the range **_lastModifiedFrom_**, **_lastModifiedTo_** |
| **_sort_** | Field on which the filter results will be sorted (doesn't participate in the filtering itself). Can be "id", "name", "createdDate", "priority", "processDefinitionId". |
| **_order_** | Sort ordering of the filter results it can be ASC or DESC (doesn't participate in the filtering itself). |
| Name | Description |
|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **_appName_** | Name of the app |
| **_status_** | Execution state of the task. |
| **_assignee_** | [`User`](lib/core/src/lib/pipes/user-initial.pipe.ts) the task is assigned to |
| **_taskName_** | Name of the task |
| **_taskId_** | ID of the task |
| **_parentTaskId_** | ID of the task's parent task |
| **_priority_** | Task priority |
| **_createdDate_** | Date the task was created |
| **_standalone_** | Standalone status of the task |
| **_owner_** | [`User`](lib/core/src/lib/pipes/user-initial.pipe.ts) ID of the task's owner |
| **_processDefinitionId_** | Process definition ID |
| **_processInstanceId_** | Process instance ID |
| **_lastModified_** | Date the task was last modified. If lastModified defined the component will show the range **_lastModifiedFrom_**, **_lastModifiedTo_** |
| **_sort_** | Field on which the filter results will be sorted (doesn't participate in the filtering itself). Can be "id", "name", "createdDate", "priority", "processDefinitionId". |
| **_order_** | Sort ordering of the filter results it can be ASC or DESC (doesn't participate in the filtering itself). |
By default, the **_status_**, **_assignee_**, **_sort_** and **_order_** properties
are displayed in the editor. However, you can also choose which properties
@@ -107,8 +107,6 @@ the editor with the **_appName_**, **_processInstanceId_**, **_createdDate_** an
**_lastModified_** properties:
```ts
import { UserProcessModel } from '@alfresco/adf-core';
export class SomeComponent implements OnInit {
filterProperties: string[] = [
@@ -124,6 +122,7 @@ export class SomeComponent implements OnInit {
onAction($event: TaskFilterAction) {
console.log('Clicked action: ', $event);
}
}
```
With this configuration, only the four listed properties will be shown.
@@ -155,6 +154,7 @@ export class SomeComponent implements OnInit {
onAction($event: TaskFilterAction) {
console.log('Clicked action: ', $event);
}
}
```
```html
@@ -171,11 +171,11 @@ With this configuration, only the three listed sort properties will be shown.
You can supply various _actions_ to apply on task filter.
| Name | Description |
| ---- | ----------- |
| **_save_** | Save task filter. |
| Name | Description |
|--------------|----------------------------|
| **_save_** | Save task filter. |
| **_saveAs_** | Creates a new task filter. |
| **_delete_** | Delete task filter. |
| **_delete_** | Delete task filter. |
By default, the **_save_**, **_saveAs_** and **_delete_** actions are
displayed in the editor. However, you can also choose which actions to
@@ -194,6 +194,7 @@ export class SomeComponent implements OnInit {
onAction($event: TaskFilterAction) {
console.log('Clicked action: ', $event);
}
}
```
```html

View File

@@ -25,7 +25,7 @@ Lists all available process filters and allows to select a filter.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | "" | (required) The application name |
| filterParam | [`FilterParamsModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) | | (optional) The filter to be selected by default |
| filterParam | `UserTaskFilterRepresentation` | | (optional) The filter to be selected by default |
| showIcons | `boolean` | false | (optional) Toggles showing an icon by the side of each filter |
### Events

View File

@@ -31,21 +31,21 @@ Shows all available filters.
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appName | `string` | "" | Display filters available to the current user for the application with the specified name. |
| filterParam | [`FilterParamsModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) | | Parameters to use for the task filter cloud. If there is no match then the default filter (the first one in the list) is selected. |
| showIcons | `boolean` | false | Toggles display of the filter's icons. |
| Name | Type | Default value | Description |
|-------------|---------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------|
| appName | `string` | "" | Display filters available to the current user for the application with the specified name. |
| filterParam | `FilterParamsModel` | | Parameters to use for the task filter cloud. If there is no match then the default filter (the first one in the list) is selected. |
| showIcons | `boolean` | false | Toggles display of the filter's icons. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs during loading. |
| filterClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`TaskFilterCloudModel`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts)`>` | Emitted when a filter is being clicked from the UI. |
| filterCounterUpdated | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`TaskCloudEngineEvent`](../../../lib/process-services-cloud/src/lib/models/engine-event-cloud.model.ts)`[]>` | Emitted when filter counters are updated. |
| filterSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`TaskFilterCloudModel`](../../../lib/process-services-cloud/src/lib/task/task-filters/models/filter-cloud.model.ts)`>` | Emitted when a filter is being selected based on the filterParam input. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the list is loaded. |
| Name | Type | Description |
|----------------------|---------------------------------------|-------------------------------------------------------------------------|
| error | `EventEmitter<any>` | Emitted when an error occurs during loading. |
| filterClicked | `EventEmitter<TaskFilterCloudModel>` | Emitted when a filter is being clicked from the UI. |
| filterCounterUpdated | `EventEmitter<TaskCloudEngineEvent>` | Emitted when filter counters are updated. |
| filterSelected | `EventEmitter`<TaskFilterCloudModel>` | Emitted when a filter is being selected based on the filterParam input. |
| success | `EventEmitter<any>` | Emitted when the list is loaded. |
## Details
@@ -59,8 +59,7 @@ Use the `filterParam` property to restrict the range of filters that are shown:
</adf-cloud-task-filters>
```
You can use properties from [`FilterParamsModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)
as the value of `filterParam` as shown in the table below:
You can use properties from `FilterParamsModel` as the value of `filterParam` as shown in the table below:
| Name | Type | Description |
| ---- | ---- | ----------- |

View File

@@ -37,17 +37,17 @@ You can show custom content when there are no apps available by supplying an
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| filtersAppId | `any[]` | | Provides a way to filter the apps to show. |
| layoutType | `string` | | (**required**) Defines the layout of the apps. There are two possible values, "GRID" and "LIST". |
| Name | Type | Default value | Description |
|--------------|----------|---------------|--------------------------------------------------------------------------------------------------|
| filtersAppId | `any[]` | | Provides a way to filter the apps to show. |
| layoutType | `string` | | (**required**) Defines the layout of the apps. There are two possible values, "GRID" and "LIST". |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| appClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`AppDefinitionRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` | Emitted when an app entry is clicked. |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
| Name | Type | Description |
|----------|---------------------------------------------|---------------------------------------|
| appClick | `EventEmitter<AppDefinitionRepresentation>` | Emitted when an app entry is clicked. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |
## Details

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2020-06-09
---
# [Form custom outcomes component](../../../lib/process-services/src/lib/form/form-custom-outcomes.component.ts "Defined in form-custom-outcomes.component.ts")
# Form Custom Outcomes Component
Supplies custom outcome buttons to be included in [Form component](form.component.md).

View File

@@ -5,11 +5,9 @@ Status: Active
Last reviewed: 2019-01-16
---
# [Form component](../../../lib/process-services/src/lib/form/form.component.ts "Defined in form.component.ts")
# Form component
Shows a [`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts) from APS
(See it live: [Form Quickstart](https://embed.plnkr.co/YSLXTqb3DtMhVJSqXKkE/))
Renders a Form from Alfresco Process Services.
## Contents

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-14
---
# [People list component](../../../lib/process-services/src/lib/people/components/people-list/people-list.component.ts "Defined in people-list.component.ts")
# People List Component
Shows a list of users (people).
@@ -16,32 +16,33 @@ Shows a list of users (people).
Populate the users in the component class:
```ts
import { UserProcessModel } from '@alfresco/adf-core';
import { LightUserRepresentation } from '@alfresco/js-api';
export class SomeComponent implements OnInit {
people: UserProcessModel[] = [
people: LightUserRepresentation[] = [
{
id: 1,
email: 'john.doe@alfresco.com',
firstName: 'John',
lastName: 'Doe'
id: 1,
email: 'john.doe@alfresco.com',
firstName: 'John',
lastName: 'Doe'
},
{
id: 2,
email: 'jane.doe@alfresco.com',
firstName: 'Jane',
lastName: 'Doe'
id: 2,
email: 'jane.doe@alfresco.com',
firstName: 'Jane',
lastName: 'Doe'
}
];
onClickPeopleRow(user: UserProcessModel) {
onClickPeopleRow(user: LightUserRepresentation) {
console.log('Clicked row: ', user);
}
onClickPeopleAction($event: Event) {
console.log('Clicked action: ', $event);
}
}
```
You can use column templates with the [people list component](people-list.component.md), since it is based on the
@@ -76,14 +77,14 @@ You can use column templates with the [people list component](people-list.compon
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| actions | `boolean` | false | Toggles whether or not actions should be visible, i.e. the 'Three-Dots' menu. |
| users | [`UserProcessModel`](../../core/models/user-process.model.md)`[]` | | The array of user data used to populate the people list. |
| Name | Type | Default value | Description |
|---------|-----------------------------|---------------|-------------------------------------------------------------------------------|
| actions | `boolean` | false | Toggles whether or not actions should be visible, i.e. the 'Three-Dots' menu. |
| users | `LightUserRepresentation[]` | | The array of user data used to populate the people list. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| clickAction | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserEventModel`](../../../lib/process-services/src/lib/task-list/models/user-event.model.ts)`>` | Emitted when the user clicks in the 'Three Dots' drop down menu for a row. |
| clickRow | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`>` | Emitted when the user clicks a row in the people list. |
| Name | Type | Description |
|-------------|-----------------------------------------|----------------------------------------------------------------------------|
| clickAction | `EventEmitter<UserEventModel>` | Emitted when the user clicks in the 'Three Dots' drop down menu for a row. |
| clickRow | `EventEmitter<LightUserRepresentation>` | Emitted when the user clicks a row in the people list. |

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2018-11-14
---
# [People Search component](../../../lib/process-services/src/lib/people/components/people-search/people-search.component.ts "Defined in people-search.component.ts")
# People Search Component
Searches users/people.
@@ -18,10 +18,10 @@ Searches users/people.
### [Transclusions](../../user-guide/transclusion.md)
You can provide a title for the search header and a label for the action button using
special sub-components in the body of the `<adf-people-search>` element:
special subcomponents in the body of the `<adf-people-search>` element:
```html
<adf-people-search ...>
<adf-people-search>
<header-title>Custom title</header-title>
<action-button-label>Custom label</action-button-label>
</adf-people-search>
@@ -31,24 +31,22 @@ special sub-components in the body of the `<adf-people-search>` element:
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| results | [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`[]>` | | Parameters for displaying the list. |
| Name | Type | Default value | Description |
|---------|-----------------------------------------|---------------|-------------------------------------|
| results | `Observable<LightUserRepresentation[]>` | | Parameters for displaying the list. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| closeSearch | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the "close" button is clicked. |
| searchPeople | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a search is performed with a new keyword. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserProcessModel`](../../core/models/user-process.model.md)`>` | Emitted when a user is selected and the action button is clicked. |
| Name | Type | Description |
|--------------|-----------------------------------------|-------------------------------------------------------------------|
| closeSearch | `EventEmitter<any>` | Emitted when the "close" button is clicked. |
| searchPeople | `EventEmitter<any>` | Emitted when a search is performed with a new keyword. |
| success | `EventEmitter<LightUserRepresentation>` | Emitted when a user is selected and the action button is clicked. |
## Details
Usage example:
<!-- {% raw %} -->
```html
<adf-people-search
(searchPeople)="searchUser($event)"
@@ -59,5 +57,3 @@ Usage example:
<action-button-label>{{ 'PEOPLE.ADD_USER' | translate }}</action-button-label>
</adf-people-search>
```
<!-- {% endraw %} -->

View File

@@ -2,26 +2,14 @@
Title: People Component
Added: v2.0.0
Status: Active
Last reviewed: 2018-11-19
Last reviewed: 2024-05-16
---
# [People Component](../../../lib/process-services/src/lib/people/components/people/people.component.ts "Defined in people.component.ts")
# People Component
Displays users involved with a specified task
![activiti-people](../../docassets/images/activiti_people.png)
## Contents
- [Basic Usage](#basic-usage)
- [Class members](#class-members)
- [Properties](#properties)
- [Details](#details)
- [How to customize the people component behavior](#how-to-customize-the-people-component-behavior)
- [Involve People single click and close search](#involve-people-single-click-and-close-search)
- [Involve People single click without close search](#involve-people-single-click-without-close-search)
- [Involve People double click and close search](#involve-people-double-click-and-close-search)
- [Involve People double double without close search](#involve-people-double-double-without-close-search)
![people component](../../docassets/images/activiti_people.png)
## Basic Usage
@@ -37,75 +25,12 @@ Displays users involved with a specified task
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| people | [`UserProcessModel`](../../core/models/user-process.model.md)`[]` | \[] | The array of User objects to display. |
| readOnly | `boolean` | false | Should the data be read-only? |
| taskId | `string` | "" | The numeric ID of the task. |
| Name | Type | Default value | Description |
|----------|-----------------------------|---------------|---------------------------------------|
| people | `LightUserRepresentation[]` | \[] | The array of User objects to display. |
| readOnly | `boolean` | false | Should the data be read-only? |
| taskId | `string` | "" | The numeric ID of the task. |
### Events
- `error`: Emitted when an error occurs.
## Details
### How to customize the people component behavior
The [people component](people.component.md) provides two options to customize its behavior:
- _involveUserAndCloseSearch_: The selected user gets added and then the search section is closed
- _involveUserWithoutCloseSearch_: The selected user gets added without closing the search section
This makes it easy to customize the [people component](people.component.md) to involve the user via a single or double click event:
### Involve People single click and close search
```html
<adf-people #people
(row-click)="people.involveUserAndCloseSearch()"
[people]="YOUR_INVOLVED_PEOPLE_LIST"
[taskId]="YOUR_TASK_ID"
[readOnly]="YOUR_READ_ONLY_FLAG">
</adf-people>
```
![involve-people-single-click-and-close-search](../../docassets/images/involve-people-single-click-and-close-search.gif)
### Involve People single click without close search
```html
<adf-people #people
(row-click)="people.involveUserWithoutCloseSearch()"
[people]="YOUR_INVOLVED_PEOPLE_LIST"
[taskId]="YOUR_TASK_ID"
[readOnly]="YOUR_READ_ONLY_FLAG">
</adf-people>
```
![involve-people-single-click-without-close-search](../../docassets/images/involve-people-single-click-without-close-search.gif)
### Involve People double click and close search
```html
<adf-people #people
(row-dblclick)="people.involveUserAndCloseSearch()"
[people]="YOUR_INVOLVED_PEOPLE_LIST"
[taskId]="YOUR_TASK_ID"
[readOnly]="YOUR_READ_ONLY_FLAG">
</adf-people>
```
![involve-people-double-click-and-close-search](../../docassets/images/involve-people-double-click-and-close-search.gif)
### Involve People double double without close search
```html
<adf-people #people
(row-dblclick)="people.involveUserWithoutCloseSearch()"
[people]="YOUR_INVOLVED_PEOPLE_LIST"
[taskId]="YOUR_TASK_ID"
[readOnly]="YOUR_READ_ONLY_FLAG">
</adf-people>
```
![involve-people-double-click-without-close-search](../../docassets/images/involve-people-double-click-without-close-search.gif)

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2018-09-14
---
# [Process Filters Component](../../../lib/process-services/src/lib/process-list/components/process-filters.component.ts "Defined in process-filters.component.ts")
# Process Filters Component
Collection of criteria used to filter process instances, which may be customized by users.
@@ -17,14 +17,12 @@ Collection of criteria used to filter process instances, which may be customized
- [Events](#events)
- [Details](#details)
- [How filter the activiti process filters](#how-filter-the-activiti-process-filters)
- [FilterParamsModel](#filterparamsmodel)
- [See also](#see-also)
## Basic Usage
```html
<adf-process-instance-filters
appId="1001">
<adf-process-instance-filters appId="1001">
</adf-process-instance-filters>
```
@@ -32,21 +30,21 @@ Collection of criteria used to filter process instances, which may be customized
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appId | `number` | | Display filters available to the current user for the application with the specified ID. |
| appName | `string` | | Display filters available to the current user for the application with the specified name. |
| filterParam | [`FilterProcessRepresentationModel`](../../../lib/process-services/src/lib/process-list/models/filter-process.model.ts) | | The parameters to filter the task filter. If there is no match then the default one (ie, the first filter in the list) is selected. |
| showIcon | `boolean` | true | Toggle to show or hide the filter's icon. |
| Name | Type | Default value | Description |
|-------------|-------------------------------------------------------------------------------------------------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------|
| appId | `number` | | Display filters available to the current user for the application with the specified ID. |
| appName | `string` | | Display filters available to the current user for the application with the specified name. |
| filterParam | [`FilterProcessRepresentationModel`](../../../lib/process-services/src/lib/process-list/models/filter-process.model.ts) | | The parameters to filter the task filter. If there is no match then the default one (ie, the first filter in the list) is selected. |
| showIcon | `boolean` | true | Toggle to show or hide the filter's icon. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
| filterClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserProcessInstanceFilterRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md)`>` | Emitted when a filter is being clicked from the UI. |
| filterSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserProcessInstanceFilterRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md)`>` | Emitted when a filter is being selected based on the filterParam input. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessInstanceFilterRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ProcessInstanceFilterRepresentation.md)`[]>` | Emitted when the list of filters has been successfully loaded from the server. |
| Name | Type | Description |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
| filterClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserProcessInstanceFilterRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md)`>` | Emitted when a filter is being clicked from the UI. |
| filterSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UserProcessInstanceFilterRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/UserProcessInstanceFilterRepresentation.md)`>` | Emitted when a filter is being selected based on the filterParam input. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessInstanceFilterRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ProcessInstanceFilterRepresentation.md)`[]>` | Emitted when the list of filters has been successfully loaded from the server. |
## Details
@@ -58,7 +56,7 @@ process instances are displayed in the list.
If both `appId` and `appName` are specified then `appName` will take precedence and `appId` will be ignored.
### How filter the activiti process filters
### How filter the Activiti process filters
```html
<adf-process-instance-filters
@@ -66,23 +64,13 @@ If both `appId` and `appName` are specified then `appName` will take precedence
</adf-process-instance-filters>
```
You can use inside the filterParam one of the properties defined by [`FilterParamsModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) (see below).
You can use inside the filterParam one of the properties defined by `UserTaskFilterRepresentation`:
### FilterParamsModel
```json
{
"id": "number",
"name": "string",
"index": "number"
}
```
| Name | Type | Description |
| ---- | ---- | ----------- |
| id | string | The id of the task filter. |
| name | string | The name of the task filter, lowercase is checked. |
| index | number | Zero-based position of the filter in the array. |
| Name | Type | Description |
|-------|--------|----------------------------------------------------|
| id | string | The id of the task filter. |
| name | string | The name of the task filter, lowercase is checked. |
| index | number | Zero-based position of the filter in the array. |
## See also

View File

@@ -22,7 +22,7 @@ Shows user information for `PROCESS` and `ALL` mode.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| bpmBackgroundImage | `string` | | Custom path for the background banner image for APS users. |
| bpmUser | [`BpmUserModel`](../../core/models/bpm-user.model.md) | | BPM user info. |
| bpmUser | UserRepresentation | | BPM user info. |
| ecmBackgroundImage | `string` | | Custom path for the background banner image for ACS users. |
| ecmUser | [`EcmUserModel`](../../core/models/ecm-user.model.md) | | ECM user info. |
| isLoggedIn | `boolean` | | Determines if user is logged in. |

View File

@@ -38,27 +38,27 @@ Starts a process.
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| appId | `number` | | (optional) Limit the list of processes that can be started to those contained in the specified app. |
| name | `string` | "" | (optional) Name to assign to the current process. |
| processDefinitionName | `string` | | (optional) Definition name of the process to start. |
| processFilterSelector | `boolean` | true | (optional) Parameter to enable selection of process when filtering. |
| showSelectApplicationDropdown | `boolean` | false | (optional) Hide or show application selection dropdown. |
| showSelectProcessDropdown | `boolean` | true | Hide or show the process selection dropdown. |
| title | `string` | | (optional) Define the header of the component. |
| values | [`FormValues`](../../../lib/core/src/lib/form/components/widgets/core/form-values.ts) | | Parameter to pass form field values in the start form if one is associated. |
| variables | [`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]` | | Variables in the input to the process [`RestVariable`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/RestVariable.md). |
| Name | Type | Default value | Description |
|-------------------------------|------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| appId | `number` | | (optional) Limit the list of processes that can be started to those contained in the specified app. |
| name | `string` | "" | (optional) Name to assign to the current process. |
| processDefinitionName | `string` | | (optional) Definition name of the process to start. |
| processFilterSelector | `boolean` | true | (optional) Parameter to enable selection of process when filtering. |
| showSelectApplicationDropdown | `boolean` | false | (optional) Hide or show application selection dropdown. |
| showSelectProcessDropdown | `boolean` | true | Hide or show the process selection dropdown. |
| title | `string` | | (optional) Define the header of the component. |
| values | `FormValues` | | Parameter to pass form field values in the start form if one is associated. |
| variables | `RestVariable[]` | | Variables in the input to the process [`RestVariable`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/RestVariable.md). |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| applicationSelection | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`AppDefinitionRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` | Emitted when application selection changes. |
| cancel | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<void>` | Emitted when the process is canceled. |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
| processDefinitionSelection | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessDefinitionRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ProcessDefinitionRepresentation.md)`>` | Emitted when process definition selection changes. |
| start | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessInstance`](../../../lib/process-services/src/lib/process-list/models/process-instance.model.ts)`>` | Emitted when the process starts. |
| Name | Type | Description |
|----------------------------|-------------------------------------------------|----------------------------------------------------|
| applicationSelection | `EventEmitterAppDefinitionRepresentation>` | Emitted when application selection changes. |
| cancel | `EventEmitter<void>` | Emitted when the process is canceled. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |
| processDefinitionSelection | `EventEmitter<ProcessDefinitionRepresentation>` | Emitted when process definition selection changes. |
| start | `EventEmitter<ProcessInstance>` | Emitted when the process starts. |
## Details
@@ -123,8 +123,8 @@ to _alfresco-1002_ as follows:
"application": {
"name": "Alfresco ADF Application"
},
"ecmHost": "http://{hostname}{:port}/ecm",
"bpmHost": "http://{hostname}{:port}/bpm",
"ecmHost": "https://{hostname}{:port}/ecm",
"bpmHost": "https://{hostname}{:port}/bpm",
"logLevel": "silent",
"alfrescoRepositoryName": "alfresco-1002"
}
@@ -135,10 +135,10 @@ You then need to pass the node as the input `values` object with the other prope
```ts
let node: Node = null;
this.nodesApiService.getNode(NODE_ID).subscribe((res) => this.node = res);
this.nodesApiService.getNode(NODE_ID).subscribe((res) => this.node = res);
const formValues: FormValues = {
'file' : node
'file' : node,
'field_one': 'example text'
};
```
@@ -149,20 +149,19 @@ You could pass multiple nodes too:
const nodes: string[] = [NODE_ID_1, NODE_ID_2];
const values: FormValues = {
'files': []
};
'files': []
};
Observable.from(nodes)
.flatMap((nodeId) => this.nodesApiService.getNode(nodeId))
.subscribe(
(node) => {
values.files.push(node);
},
(error) => console.log(error) ,
() => {
this.formValues = values;
});
});
Observable.from(nodes)
.flatMap((nodeId) => this.nodesApiService.getNode(nodeId))
.subscribe(
(node) => {
values.files.push(node);
},
(error) => console.log(error),
() => {
this.formValues = values;
});
```
Note that in the object above, the key `file` is the name of the attach file field in the start form of the process. The value of the `file` property must be a
@@ -211,9 +210,11 @@ When an error occurs, the component will emit an error event that can be used to
```
```ts
class StartProcessComponent {
onError(error) {
this.notificationService.showError(event.response.body.message);
}
}
```
## See also

View File

@@ -23,17 +23,17 @@ Shows all available filters.
| ---- | ---- | ------------- | ----------- |
| appId | `number` | | Display filters available to the current user for the application with the specified ID. |
| appName | `string` | | Display filters available to the current user for the application with the specified name. |
| filterParam | [`FilterParamsModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) | | Parameters to use for the task filter. If there is no match then the default filter (the first one the list) is selected. |
| filterParam | `UserTaskFilterRepresentation` | | Parameters to use for the task filter. If there is no match then the default filter (the first one the list) is selected. |
| showIcon | `boolean` | | Toggles display of the filter's icon. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs during loading. |
| filterClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` | Emitted when a filter is being clicked from the UI. |
| filterSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` | Emitted when a filter is being selected based on the filterParam input. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the list is loaded. |
| Name | Type | Description |
| ---- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs during loading. |
| filterClicked | `EventEmitter<UserTaskFilterRepresentation>` | Emitted when a filter is being clicked from the UI. |
| filterSelected | `EventEmitter<UserTaskFilterRepresentation>` | Emitted when a filter is being selected based on the filterParam input. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the list is loaded. |
## Details
@@ -42,16 +42,14 @@ Shows all available filters.
Use the `filterParam` property to restrict the range of filters that are shown:
```html
<adf-task-filters
[filterParam]="{name:'My tasks'}">
<adf-task-filters [filterParam]="{name:'My tasks'}">
</adf-task-filters>
```
You can use properties from [`FilterParamsModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)
as the value of `filterParam` as shown in the table below:
You can use properties from `UserTaskFilterRepresentation` as the value of `filterParam` as shown in the table below:
| Name | Type | Description |
| ---- | ---- | ----------- |
| id | string | The id of the task filter |
| name | string | The name of the task filter, lowercase is checked |
| Name | Type | Description |
|-------|--------|-----------------------------------------------------|
| id | string | The id of the task filter |
| name | string | The name of the task filter, lowercase is checked |
| index | string | The zero-based position of the filter in the array. |

View File

@@ -13,29 +13,29 @@ Manages process instances, process variables, and process audit Log.
### Methods
- **cancelProcess**(processInstanceId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<void>`<br/>
- **cancelProcess**(processInstanceId: `string`): `Observable<void>`<br/>
Cancels a process instance.
- _processInstanceId:_ `string` - ID of process to cancel
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<void>` - Null response notifying when the operation is complete
- **createOrUpdateProcessInstanceVariables**(processInstanceId: `string`, variables: [`RestVariable`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/RestVariable.md)`[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]>`<br/>
- **Returns** `Observable<void>` - Null response notifying when the operation is complete
- **createOrUpdateProcessInstanceVariables**(processInstanceId: `string`, variables: `RestVariable`[]`): `Observable<RestVariable[]>`<br/>
Creates or updates variables for a process instance.
- _processInstanceId:_ `string` - ID of the target process
- _variables:_ [`RestVariable`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/RestVariable.md)`[]` - Variables to update
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]>` - Array of instance variable info
- **deleteProcessInstanceVariable**(processInstanceId: `string`, variableName: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<void>`<br/>
- _variables:_ `RestVariable[]` - Variables to update
- **Returns** `Observable<ProcessInstanceVariable[]>` - Array of instance variable info
- **deleteProcessInstanceVariable**(processInstanceId: `string`, variableName: `string`): `Observable<void>`<br/>
Deletes a variable for a process instance.
- _processInstanceId:_ `string` - ID of the target process
- _variableName:_ `string` - Name of the variable to delete
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<void>` - Null response notifying when the operation is complete
- **fetchProcessAuditJsonById**(processId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
- **Returns** `Observable<void>` - Null response notifying when the operation is complete
- **fetchProcessAuditJsonById**(processId: `string`): `Observable<any>`<br/>
Fetches the Process Audit information in a JSON format.
- _processId:_ `string` - ID of the target process
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - JSON data
- **Returns** `Observable<any>` - JSON data
- **fetchProcessAuditPdfById**(processId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)`>`<br/>
Fetches the Process Audit information as a PDF.
- _processId:_ `string` - ID of the target process
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)`>` - Binary PDF data
- **getProcess**(processInstanceId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstance`](../../../lib/process-services/src/lib/process-list/models/process-instance.model.ts)`>`<br/>
- **Returns** `Observable<Blob>` - Binary PDF data
- **getProcess**(processInstanceId: `string`): `Observable<ProcessInstance>`<br/>
Gets Process Instance metadata.
- _processInstanceId:_ `string` - ID of the target process
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstance`](../../../lib/process-services/src/lib/process-list/models/process-instance.model.ts)`>` - Metadata for the instance
@@ -43,10 +43,10 @@ Manages process instances, process variables, and process audit Log.
Gets process definitions associated with an app.
- _appId:_ `number` - (Optional) ID of a target app
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessDefinitionRepresentation`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ProcessDefinitionRepresentation.md)`[]>` - Array of process definitions
- **getProcessInstanceVariables**(processInstanceId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]>`<br/>
- **getProcessInstanceVariables**(processInstanceId: `string`): `ObservableRestVariable[]>`<br/>
Gets the variables for a process instance.
- _processInstanceId:_ `string` - ID of the target process
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]>` - Array of instance variable info
- **Returns** `ObservableRestVariable[]>` - Array of instance variable info
- **getProcessInstances**(requestNode: [`ProcessFilterParamRepresentationModel`](../../../lib/process-services/src/lib/process-list/models/filter-process.model.ts), processDefinitionKey?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessListModel`](../../../lib/process-services/src/lib/process-list/models/process-list.model.ts)`>`<br/>
Gets process instances for a filter and optionally a process definition.
- _requestNode:_ [`ProcessFilterParamRepresentationModel`](../../../lib/process-services/src/lib/process-list/models/filter-process.model.ts) - Filter for instances
@@ -70,14 +70,14 @@ Manages process instances, process variables, and process audit Log.
Gets the start form instance for a given process.
- _processId:_ `string` - Process definition ID
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Form definition
- **startProcess**(processDefinitionId: `string`, name: `string`, outcome?: `string`, startFormValues?: [`FormValues`](../../../lib/core/src/lib/form/components/widgets/core/form-values.ts), variables?: [`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstance`](../../../lib/process-services/src/lib/process-list/models/process-instance.model.ts)`>`<br/>
- **startProcess**(processDefinitionId: `string`, name: `string`, outcome?: `string`, startFormValues?: `FormValues`, variables?: `RestVariable[]`): `Observable<ProcessInstance>`<br/>
Starts a process based on a process definition, name, form values or variables.
- _processDefinitionId:_ `string` - Process definition ID
- _name:_ `string` - Process name
- _outcome:_ `string` - (Optional) Process outcome
- _startFormValues:_ [`FormValues`](../../../lib/core/src/lib/form/components/widgets/core/form-values.ts) - (Optional) Values for the start form
- _variables:_ [`ProcessInstanceVariable`](../../../lib/process-services/src/lib/process-list/models/process-instance-variable.model.ts)`[]` - (Optional) Array of process instance variables
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`ProcessInstance`](../../../lib/process-services/src/lib/process-list/models/process-instance.model.ts)`>` - Details of the process instance just started
- _variables:_ `RestVariable[]` - (Optional) Array of process instance variables
- **Returns** `Observable<ProcessInstance>` - Details of the process instance just started
- **toJson**(res: `any`): `any`<br/>
Creates a JSON representation of form data.
- _res:_ `any` - Object representing form data

View File

@@ -13,69 +13,74 @@ Manage Task Filters, which are pre-configured Task Instance queries.
### Methods
- **addFilter**(filter: [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>`<br/>
- **addFilter**(filter: `UserTaskFilterRepresentation`): `Observable<UserTaskFilterRepresentation>`<br/>
Adds a new task filter
- _filter:_ [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - The new filter to add
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` - Details of task filter just added
- _filter:_ `UserTaskFilterRepresentation` - The new filter to add
- **Returns** `Observable<UserTaskFilterRepresentation>` - Details of task filter just added
- **callApiTaskFilters**(appId?: `number`): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<any>`<br/>
Calls `getUserTaskFilters` from the Alfresco JS API.
- _appId:_ `number` - (Optional) ID of the target app
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<any>` - List of task filters
- **createDefaultFilters**(appId: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`[]>`<br/>
- **createDefaultFilters**(appId: `number`): `Observable<UserTaskFilterRepresentation>[]>`<br/>
Creates and returns the default filters for a process app.
- _appId:_ `number` - ID of the target app
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`[]>` - Array of default filters just created
- **getCompletedTasksFilterInstance**(appId: `number`, index?: `number`): [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)<br/>
- **Returns** `Observable<UserTaskFilterRepresentation>[]>` - Array of default filters just created
- **getCompletedTasksFilterInstance**(appId: `number`, index?: `number`): `UserTaskFilterRepresentation`<br/>
Creates and returns a filter for "Completed" task instances.
- _appId:_ `number` - ID of the target app
- _index:_ `number` - (Optional) of the filter (optional)
- **Returns** [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - The newly created filter
- **getInvolvedTasksFilterInstance**(appId: `number`, index?: `number`): [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)<br/>
- **Returns** `UserTaskFilterRepresentation` - The newly created filter
- **getInvolvedTasksFilterInstance**(appId: `number`, index?: `number`): `UserTaskFilterRepresentation`<br/>
Creates and returns a filter for "Involved" task instances.
- _appId:_ `number` - ID of the target app
- _index:_ `number` - (Optional) of the filter (optional)
- **Returns** [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - The newly created filter
- **getMyTasksFilterInstance**(appId: `number`, index?: `number`): [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)<br/>
- **Returns** `UserTaskFilterRepresentation` - The newly created filter
- **getMyTasksFilterInstance**(appId: `number`, index?: `number`): `UserTaskFilterRepresentation`<br/>
Creates and returns a filter for "My Tasks" task instances.
- _appId:_ `number` - ID of the target app
- _index:_ `number` - (Optional) of the filter (optional)
- **Returns** [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - The newly created filter
- **getQueuedTasksFilterInstance**(appId: `number`, index?: `number`): [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)<br/>
- **Returns** `UserTaskFilterRepresentation` - The newly created filter
- **getQueuedTasksFilterInstance**(appId: `number`, index?: `number`): `UserTaskFilterRepresentation`<br/>
Creates and returns a filter for "Queued Tasks" task instances.
- _appId:_ `number` - ID of the target app
- _index:_ `number` - (Optional) of the filter (optional)
- **Returns** [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - The newly created filter
- **getTaskFilterById**(filterId: `number`, appId?: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>`<br/>
- **Returns** `UserTaskFilterRepresentation` - The newly created filter
- **getTaskFilterById**(filterId: `number`, appId?: `number`): `Observable<UserTaskFilterRepresentation>`<br/>
Gets a task filter by ID.
- _filterId:_ `number` - ID of the filter
- _appId:_ `number` - (Optional) ID of the app for the filter
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` - Details of task filter
- **getTaskFilterByName**(taskName: `string`, appId?: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>`<br/>
- **Returns** `Observable<UserTaskFilterRepresentation>` - Details of task filter
- **getTaskFilterByName**(taskName: `string`, appId?: `number`): `Observable<UserTaskFilterRepresentation>`<br/>
Gets a task filter by name.
- _taskName:_ `string` - Name of the filter
- _appId:_ `number` - (Optional) ID of the app for the filter
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` - Details of task filter
- **getTaskListFilters**(appId?: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`[]>`<br/>
- **Returns** `ObservableUserTaskFilterRepresentation>` - Details of task filter
- **getTaskListFilters**(appId?: `number`): `UserTaskFilterRepresentation[]>`<br/>
Gets all task filters for a process app.
- _appId:_ `number` - (Optional) Optional ID for a specific app
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`[]>` - Array of task filter details
- **Returns** `Observable<UserTaskFilterRepresentation[]>` - Array of task filter details
## Details
The methods of this service generally return an instance of [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) or
The methods of this service generally return an instance of `UserTaskFilterRepresentation` or
an array of instances. For example, you could use `getTaskListFilters` as follows:
```ts
const processAppId = 2;
this.taskFilterService.getTaskListFilters(processAppId).subscribe( (filters: FilterRepresentationModel[]) => {
console.log('Task filters: ', filters);
}, error => {
console.log('Error: ', error);
});
this.taskFilterService.getTaskListFilters(processAppId).subscribe(
(filters: UserTaskFilterRepresentation[]) => {
console.log('Task filters: ', filters);
},
(error) => {
console.log('Error: ', error);
}
);
```
The response is an array of [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) objects:
The response is an array of `UserTaskFilterRepresentation` objects:
```text
filters:
0: {id: 10, appId: 2, name: "Involved Tasks", recent: true, icon: "glyphicon-align-left", …}
1: {id: 9, appId: 2, name: "My Tasks", recent: false, icon: "glyphicon-inbox", …}
@@ -85,6 +90,7 @@ The response is an array of [`FilterRepresentationModel`](../../../lib/process-s
5: {id: 4005, appId: 2, name: "My Tasks", recent: false, icon: "glyphicon-inbox", …}
6: {id: 4006, appId: 2, name: "Queued Tasks", recent: false, icon: "glyphicon-record", …}
7: {id: 4007, appId: 2, name: "Involved Tasks", recent: false, icon: "glyphicon-align-left", …}
```
These filters can now be used to get matching task instances for the process app with ID 2,
such as 'Involved Tasks', 'My Tasks', 'Queued Tasks', and 'Completed Tasks'.
@@ -92,12 +98,12 @@ such as 'Involved Tasks', 'My Tasks', 'Queued Tasks', and 'Completed Tasks'.
### Importing
```ts
import { TaskFilterService, FilterRepresentationModel } from '@alfresco/adf-process-services';
import { TaskFilterService } from '@alfresco/adf-process-services';
export class SomePageComponent implements OnInit {
constructor(private taskFilterService: TaskFilterService) {
}
constructor(private taskFilterService: TaskFilterService) {
}
}
```
## See also

View File

@@ -5,10 +5,14 @@ Status: Active
Last reviewed: 2018-11-14
---
# [Tasklist Service](../../../lib/process-services/src/lib/task-list/services/tasklist.service.ts "Defined in tasklist.service.ts")
# TaskList Service
Manages Task Instances.
```ts
import { TaskListService } from '@alfresco/adf-process-services';
```
## Class members
### Methods
@@ -60,22 +64,17 @@ Manages Task Instances.
Fetches the Task Audit information in PDF format.
- _taskId:_ `string` - ID of the target task
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)`>` - Binary PDF data
- **findAllTasksByState**(requestNode: [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts), state?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts)`>`<br/>
Gets all tasks matching a query and state value.
- _requestNode:_ [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - Query to search for tasks.
- _state:_ `string` - (Optional) Task state. Can be "open" or "completed". State "all" applies to both "active" and "completed" tasks.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts)`>` - List of tasks
- **findTasksByState**(requestNode: [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts), state?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts)`>`<br/>
- **findTasksByState**(requestNode: `TaskQueryRequestRepresentationModel`, state?: `string`): `Observable<ResultListDataRepresentationTaskRepresentation>`<br/>
Gets tasks matching a query and state value.
- _requestNode:_ [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - Query to search for tasks
- _requestNode:_ `TaskQueryRequestRepresentationModel` - Query to search for tasks
- _state:_ `string` - (Optional) Task state. Can be "open" or "completed". State "all" applies to both "active" and "completed" tasks.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts)`>` - List of tasks
- **getFilterForTaskById**(taskId: `string`, filterList: [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>`<br/>
- **Returns** `Observable<ResultListDataRepresentationTaskRepresentation>` - List of tasks
- **getFilterForTaskById**(taskId: `string`, filterList: `UserTaskFilterRepresentation[]`): `Observable<UserTaskFilterRepresentation>`<br/>
Gets all the filters in the list that belong to a task.
- _taskId:_ `string` - ID of the target task
- _filterList:_ [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`[]` - List of filters to search through
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` - Filters belonging to the task
- **getFormList**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts)`[]>`<br/>
- _filterList:_ `UserTaskFilterRepresentation[]` - List of filters to search through
- **Returns** `Observable<UserTaskFilterRepresentation>` - Filters belonging to the task
- **getFormList**(): `Observable<Form[]>`<br/>
Gets all available reusable forms.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`Form`](../../../lib/process-services/src/lib/task-list/models/form.model.ts)`[]>` - Array of form details
- **getTaskChecklist**(id: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts)`[]>`<br/>
@@ -85,21 +84,21 @@ Manages Task Instances.
- **getTaskDetails**(taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts)`>`<br/>
Gets details for a task.
- _taskId:_ `string` - ID of the target task.
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts)`>` - Task details
- **getTasks**(requestNode: [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts)`>`<br/>
- **Returns** `Observable<TaskDetailsModel>` - Task details
- **getTasks**(requestNode: `TaskQueryRequestRepresentationModel`): `Observable<ResultListDataRepresentationTaskRepresentation>`<br/>
Gets all the tasks matching the supplied query.
- _requestNode:_ [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - Query to search for tasks
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts)`>` - List of tasks
- **getTotalTasks**(requestNode: [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
- _requestNode:_ `TaskQueryRequestRepresentationModel` - Query to search for tasks
- **Returns** `Observable<ResultListDataRepresentationTaskRepresentation>` - List of tasks
- **getTotalTasks**(requestNode: `TaskQueryRequestRepresentationModel`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
Gets the total number of the tasks found by a query.
- _requestNode:_ [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - Query to search for tasks
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Number of tasks
- **isTaskRelatedToFilter**(taskId: `string`, filterModel: [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>`<br/>
- _requestNode:_ `TaskQueryRequestRepresentationModel` - Query to search for tasks
- **Returns** `Observable<any>` - Number of tasks
- **isTaskRelatedToFilter**(taskId: `string`, filterModel: `UserTaskFilterRepresentation`): `Observable<UserTaskFilterRepresentation`>`<br/>
Checks if a taskId is filtered with the given filter.
- _taskId:_ `string` - ID of the target task
- _filterModel:_ [`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) - The filter you want to check
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`FilterRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts)`>` - The filter if it is related or null otherwise
- **unclaimTask**(taskId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts)`>`<br/>
- _filterModel:_ `UserTaskFilterRepresentation` - The filter you want to check
- **Returns** `Observable<UserTaskFilterRepresentation>` - The filter if it is related or null otherwise
- **unclaimTask**(taskId: `string`): `Observable<TaskDetailsModel>`<br/>
Un-claims a task for the current user.
- _taskId:_ `string` - ID of the task to unclaim
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts)`>` - Null response notifying when the operation is complete
@@ -128,8 +127,9 @@ this.tasklistService.getTaskDetails(taskInstanceId).subscribe( (taskInstance: Ta
The resulting [`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts) object contains information like the following:
```text
adhocTaskCanBeReassigned: false
assignee: UserProcessModel {pictureId: null, id: 1, email: "admin@app.activiti.com", firstName: null, lastName: "Administrator"}
assignee: LightUserRepresentation {pictureId: null, id: 1, email: "admin@app.activiti.com", firstName: null, lastName: "Administrator"}
category: null
created: Wed Oct 11 2017 09:07:14 GMT+0100 (BST) {}
description: null
@@ -159,10 +159,11 @@ The resulting [`TaskDetailsModel`](../../../lib/process-services/src/lib/task-li
processInstanceName: null
processInstanceStartUserId: "1"
taskDefinitionKey: "clarifyInvoice"
```
### Queries
Some of the methods run a search query contained in a [`TaskQueryRequestRepresentationModel`](../../../lib/process-services/src/lib/task-list/models/filter.model.ts) and
Some of the methods run a search query contained in a `TaskQueryRequestRepresentationModel` and
return the matched tasks. Below is an example of how you might run a query using `getTasks`:
```ts
@@ -178,7 +179,8 @@ const taskQuery: TaskQueryRequestRepresentationModel = {
size: 5,
start: null
};
this.tasklistService.getTasks(taskQuery).subscribe( (taskListModel: TaskListModel) => {
this.tasklistService.getTasks(taskQuery).subscribe((taskListModel) => {
console.log('Task List Model: ', taskListModel);
}, error => {
console.log('Error: ', error);
@@ -201,9 +203,9 @@ The `assignment` property filters tasks based on how they are assigned (or not a
Use `assignee` if you are interested in tasks that are assigned to a user. If you want to see
pooled tasks (i.e. tasks that needs to be claimed by a user), then use `candidate`.
A successful query returns a [`TaskListModel`](../../../lib/process-services/src/lib/task-list/models/task-list.model.ts) with the `data` property set to an array of
[`TaskDetailsModel`](../../../lib/process-services/src/lib/task-list/models/task-details.model.ts):
A successful query returns a `ResultListDataRepresentationTaskRepresentation` with the `data` property set to an array of `TaskRepresentation` objects. For example:
```text
data:
0: {id: "75010", name: "Approve Invoice - Invoice-10202.pdf", description: null, category: null, assignee: {…}, …}
1: {id: "74746", name: "Verify with the person that did the purchase", description: null, category: "2", assignee: {…}, …}
@@ -214,18 +216,7 @@ A successful query returns a [`TaskListModel`](../../../lib/process-services/src
size: 5
start: 0
total: 10
```
The `total` property indicates that actual number of tasks that were found, but the `size` property
limited the found set to five items.
### Importing
```ts
import { TaskListService, TaskDetailsModel, TaskQueryRequestRepresentationModel, TaskListModel, Form } from '@alfresco/adf-process-services';
import { TaskUpdateRepresentation } from '@alfresco/js-api';
export class SomePageComponent implements OnInit {
constructor(private tasklistService: TaskListService) {
}
```

View File

@@ -520,7 +520,6 @@ backend services have been tested with each released version of ADF.
- [Auth guard ecm service](core/services/auth-guard-ecm.service.md)
- [Auth guard service](core/services/auth-guard.service.md)
- [Authentication service](core/services/authentication.service.md)
- [Bpm user model](core/models/bpm-user.model.md)
- [Bpm user service](core/services/bpm-user.service.md)
- [Breadcrumb component](content-services/components/breadcrumb.component.md)
- [Card item types service](core/services/card-item-types.service.md)
@@ -652,7 +651,6 @@ backend services have been tested with each released version of ADF.
- [Upload service](core/services/upload.service.md)
- [User initial pipe](core/pipes/user-initial.pipe.md)
- [User preferences service](core/services/user-preferences.service.md)
- [User process model](core/models/user-process.model.md)
- [Version list component](content-services/components/version-list.component.md)
- [Version manager component](content-services/components/version-manager.component.md)
- [Viewer component](core/components/viewer.component.md)