alfresco-ng2-components/docs/process-list.component.md
siva kumar 1a41da514b [ADF-2123] Process Pagination - There is no way to paginate the result (#2946)
* [ADF- 2123] Process Pagination - There is no way to paginate the result

* Updated unimplemented pagination method.

* * Refactored process-service component.

* * Removed unused  pagination methods from process-service component.

* * Updated process/task list documentation with recent changes.
2018-02-15 10:20:23 +00:00

105 lines
3.0 KiB
Markdown

# Process Instance List
Renders a list containing all the process instances matched by the parameters specified.
## Basic Usage
**app.component.html**
```html
<adf-process-instance-list
[appId]="'1'"
[state]="'open'">
</adf-process-instance-list>
```
You can also use custom schema declaration as shown below:
define custom schema in the app.config.json as shown below json format.
```json
"adf-process-list": {
"presets": {
"customSchema": [
{
"key": "name",
"type": "text",
"title": "name",
"sortable": true
}],
"default": [
{
"key": "name",
"type": "text",
"title": "name",
"sortable": true
}],
}
}
```
```html
<adf-process-instance-list
[appId]="'1'"
[state]="'open'"
[presetColumn]="'customSchema'">
</adf-process-instance-list>
```
### Pagination strategy
adf-process-instance-list also supports pagination and the same can be used as shown below.
```html
<adf-process-instance-list
[appId]="'1'"
[page]="page"
[size]="size"
#processList>
</adf-process-instance-list>
<adf-pagination
*ngIf="processList"
[target]="processList"
[supportedPageSizes]="supportedPages"
#processListPagination>
</adf-pagination>
```
### Properties
| Name | Description | | |
| ---- | ----------- | --- | --- |
| appId | The id of the app. | | |
| processDefinitionKey | The processDefinitionKey of the process. | | |
| presetColumn | string | | The presetColumn of the custom schema to fetch. |
| state | Define state of the processes. Possible values are `running`, `completed` and `all` | | |
| sort | Define sort of the processes. Possible values are `created-desc`, `created-asc`, `ended-desc`, `ended-asc` | | |
| page | number | 0 | The page of the tasks to fetch. |
| size | number | 25 | The number of tasks to fetch. |
| schemaColumn | List of columns to display in the process instances datatable (see the [Details](#details) section below) | | |
### Events
| Name | Description |
| ---- | ----------- |
| rowClick | Emitted when a row in the process list is clicked |
| success | Emitted when the list of process instances has been loaded successfully from the server |
| error | Emitted when an error is encountered loading the list of process instances from the server |
## Details
Example value for the schemaColumn property (see [Properties](#properties) section above):
```json
[
{type: 'text', key: 'id', title: 'Id', sortable: true},
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true},
{type: 'text', key: 'started', title: 'Started', sortable: true},
{type: 'text', key: 'startedBy.email', title: 'Started By', sortable: true}
]
```
## See also
- [Data column component](data-column.component.md)
- [DataTableAdapter](DataTableAdapter.md)
- [Pagination component](pagination.component.md)