mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* [AAE-33090] Add optional checkbox for 'open next task' feature * [AAE-33090] move translation to LABEL property * [33090] add unit tests * add tests for checkbox value * [AAE-33090] remove some comments * [AAE-33090] update documentation * AAE-33090 kind of a typo * AAE-33090 remove all comments
94 lines
4.6 KiB
Markdown
94 lines
4.6 KiB
Markdown
---
|
|
Title: Start Process Cloud Component
|
|
Added: v3.0.0
|
|
Status: Experimental
|
|
Last reviewed: 2019-03-20
|
|
---
|
|
|
|
# [Start Process Cloud Component](../../../lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts "Defined in start-process-cloud.component.ts")
|
|
|
|
Starts a process.
|
|
|
|

|
|
|
|
## Contents
|
|
|
|
- [Basic Usage](#basic-usage)
|
|
- [Class members](#class-members)
|
|
- [Properties](#properties)
|
|
- [Events](#events)
|
|
- [Details](#details)
|
|
- [Starting a process with a default name and a pre-selected process definition name](#starting-a-process-with-a-default-name-and-a-pre-selected-process-definition-name)
|
|
- [Starting a process with variables](#starting-a-process-with-variables)
|
|
- [Starting a process with values passed to the form](#starting-a-process-with-values-passed-to-the-form)
|
|
|
|
## Basic Usage
|
|
|
|
```html
|
|
<adf-cloud-start-process
|
|
[appName]="YOUR_APP_NAME">
|
|
</adf-cloud-start-process>
|
|
```
|
|
|
|
## Class members
|
|
|
|
### Properties
|
|
|
|
| Name | Type | Default value | Description |
|
|
| ---- | ---- | ------------- | ----------- |
|
|
| appName | `string` | "" | (required) Name of the app. |
|
|
| isNextTaskCheckboxChecked | `boolean` | false | Whether the `Open next task` checkbox is checked by default or not. |
|
|
| maxNameLength | `number` | MAX_NAME_LENGTH | Maximum length of the process name. |
|
|
| name | `string` | "" | Name of the process. |
|
|
| processDefinitionName | `string` | | Name of the process definition. |
|
|
| showNextTaskCheckbox | `boolean` | false | Toggle rendering of the `Open next task` checkbox. |
|
|
| showSelectProcessDropdown | `boolean` | true | Show/hide the process dropdown list. |
|
|
| showTitle | `boolean` | true | Show/hide title. |
|
|
| values | [`TaskVariableCloud`](../../../lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts)`[]` | | Parameter to pass form field values in the start form if one is associated. |
|
|
| variables | `any` | | Variables to attach to the payload. |
|
|
|
|
### Events
|
|
|
|
| Name | Type | Description |
|
|
| ---- | ---- | ----------- |
|
|
| cancel | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` | Emitted when the starting process is cancelled |
|
|
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` | Emitted when an error occurs. |
|
|
| formContentClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ContentLinkModel`](../../../lib/core/src/lib/form/components/widgets/core/content-link.model.ts)`>` | Emitted when form content is clicked. |
|
|
| nextTaskCheckboxCheckedChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MatCheckboxChange`](https://material.angular.io/components/checkbox/api#MatCheckboxChange)`>` | Emitted when the `Open next task` checkbox was toggled. |
|
|
| processDefinitionSelection | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessDefinitionCloud`](../../../lib/process-services-cloud/src/lib/models/process-definition-cloud.model.ts)`>` | Emitted when process definition selection changes. |
|
|
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessInstanceCloud`](../../../lib/process-services-cloud/src/lib/process/start-process/models/process-instance-cloud.model.ts)`>` | Emitted when the process is successfully started. |
|
|
|
|
## Details
|
|
|
|
### Starting a process with a default name and a pre-selected process definition name
|
|
|
|
```html
|
|
<adf-cloud-start-process
|
|
[appName]="YOUR_APP_NAME"
|
|
[name]="PROCESS_NAME"
|
|
[processDefinitionName]="PROCESS_DEFINITION_NAME">
|
|
</adf-cloud-start-process>
|
|
```
|
|
|
|
You can use the `processDefinitionName` property to select which process will be selected by default on the dropdown (when there is more than one process to choose from). Use the `name` property to set the name shown on the dropdown item.
|
|
|
|
If the app contains only one process definition, this process definition will be selected by default
|
|
|
|
### Starting a process with variables
|
|
|
|
```html
|
|
<adf-cloud-start-process
|
|
[appName]="YOUR_APP_NAME"
|
|
[variables]="{ 'my-key1' : 'myvalue', 'my-key2' : 'myvalue2'}">
|
|
</adf-cloud-start-process>
|
|
```
|
|
|
|
### Starting a process with values passed to the form
|
|
|
|
```html
|
|
<adf-cloud-start-process
|
|
[appName]="YOUR_APP_NAME"
|
|
[values]="[{'name': 'firstName', 'value': 'MyName'}, {'name': 'lastName', 'value': 'MyLastName'}]">
|
|
</adf-cloud-start-process>
|
|
```
|