[ADF-2188] Start Process - Change processDefinition property and fix bug (#2884)

* Change processDefinition property and fix bug

* Fix unit test

* Fix async

* Fix id
This commit is contained in:
Maurizio Vitale
2018-01-25 17:52:05 +01:00
committed by Eugenio Romano
parent abca6e481d
commit 657c28491a
7 changed files with 43 additions and 32 deletions

View File

@@ -18,7 +18,7 @@ Starts a process.
| ---- | -- | ----------- |
| 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 |
| processDefinition | `string` | (optional) definition name of the process to start |
| processDefinitionName | `string` | (optional) definition name 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 |
@@ -31,26 +31,30 @@ Starts a process.
| cancel | `EventEmitter<ProcessInstance>` | Emitted when the process is canceled |
| error | `EventEmitter<ProcessInstance>` | Emitted when the start process operation fails |
### Start a process part of an app
### Start a process with a default name and pre-selected process definition name
```html
<adf-start-process
[appId]="YOUR_APP_ID"
[processDefinition]="PROCESS_DEFINITION">
[name]="PROCESS_NAME"
[processDefinitionName]="PROCESS_DEFINITION_NAME">
</adf-start-process>
```
Use this method to preselect which process to start if there is more than one process in your app.
If your app has more than one process definition, with the property processDefinitionName you can select as dropdown default value your PROCESS_DEFINITION_NAME. The name will be the PROCESS_NAME.
You can configure the processDefinitionName value in your custom `app.config.json`
You can configure the process name value in your custom `app.config.json`
### Start a process not included in an app
```html
<adf-start-process
[processDefinition]="PROCESS_DEFINITION">
[processDefinitionName]="PROCESS_DEFINITION_NAME">
</adf-start-process>
```
Use this method to preselect which process to start
With the property processDefinitionName you can select as dropdown default value your PROCESS_DEFINITION_NAME.
You can configure the processDefinitionName values in your custom `app.config.json`
### Custom data example