[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

@@ -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) {
}
```