[ADF-1880] More configuration options for adf-start-process component (#2869)

* procesdefinitionId set
show dropdown multiple process

* fix sourcemap

* fix test start process

* fix test

* changes after code review

* add show dropdown optional

* remove fit fdescribe

* processDefinitionId in processDefinition change

* improve tests
This commit is contained in:
Eugenio Romano
2018-01-24 15:40:42 +00:00
committed by GitHub
parent 5152a90592
commit b3a9e1a884
9 changed files with 444 additions and 430 deletions

View File

@@ -16,11 +16,12 @@ Starts a process.
| Name | Type | Description |
| ---- | -- | ----------- |
| appId | `number` | (required): Limit the list of processes which can be started to those contained in the specified app |
| appId | `number` | (optional): Limit the list of processes which can be started to those contained in the specified app |
| name | `string` | (optional) name to assign to the current process |
| processDefinitionId | `string` | (optional) definition ID of the process to start |
| variables | `ProcessInstanceVariable[]` |Variables in input to the process [RestVariable](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-activiti-rest-api/docs/RestVariable.md) |
| values | `FormValues` | Parameter to pass form field values in the start form if is associated |
| showSelectProcessDropdown | `boolean` | hide or show the process selection drodown, true by default |
### Events
@@ -30,31 +31,30 @@ Starts a process.
| cancel | `EventEmitter<ProcessInstance>` | Emitted when the process is canceled |
| error | `EventEmitter<ProcessInstance>` | Emitted when the start process operation fails |
## Details
Displays the *Start Process* form, allowing the user to specify some details like process name and process definition, which are the most basic requirements to start a new process instance. The following
options are available for choosing which process to start:
- If your app has only one `processDefinition` then the `adf-start-process` component will iind and
use it automatically.
- If your app has multiple `processDefinitions` and you don't define a `processDefinitionId` parameter
then a drop down will allow you to select which one to use.
- If your app has multiple `processDefinitions` and you do define a `processDefinitionId` parameter then the `adf-start-process` component will be automatically instantiated with the selected process.
An error message will be shown if no process definition at all is available.
### Start a process with processDefinitionId
### Start a process part of an app
```html
<adf-start-process
[appId]="YOUR_APP_ID"
[processName]="PROCESS_NAME"
[processDefinitionId]="PROCESS_DEF_ID">
[processDefinition]="PROCESS_DEFINITION">
</adf-start-process>
```
Use this method to preselect which process to start if there is more than one process in your app.
### Start a process not included in an app
```html
<adf-start-process
[processName]="PROCESS_NAME"
[processDefinition]="PROCESS_DEFINITION">
</adf-start-process>
```
Use this method to preselect which process to start
### Custom data example
Here is an example of how to pass in form field values to initialize the start form that has been