Table of Contents |
---|
...
Flowable workflow components (configuration bean, WorkflowComponent and TaskComponent implementation and other services) located in module ecos-flowable-repo. To start and register Flowable workflow components, it's necessary to set connection parameters to the external database in alfresco-global.properties file.
Code Block |
---|
flowable.db.url=jdbc:postgresql://127.0.0.1/bpm_service flowable.db.username=bpm_service flowable.db.password=123123 flowable.db.driver.class.name=org.postgresql.Driver |
On application start if database connection parameters are set correctly, all Flowable workflow components will be automatically registered, including global GlobalTaskListeners and GlobalExecutionListener (Task and Execution listeners are called on every tasks and executions).
Process definition deploying
...
For script execution on tasks or executions events are used ru.citeck.ecos.flowable.listeners.FlowableScriptExecutionListener and ru.citeck.ecos.flowable.listeners.FlowableScriptTaskListener. They implement org.flowable.engine.delegate.ExecutionListener and org.flowable.engine.delegate.TaskListener respectively. There're available fields:
Field | Description |
---|---|
script | Script expression |
language | Script language. Default value is javascript |
resultVariable | Script execution result variable |
Example of script execution
Code Block | ||
---|---|---|
| ||
<activiti:executionListener event="start" class="ru.citeck.ecos.flowable.listeners.FlowableScriptExecutionListener"> <activiti:field name="script"> <activiti:expression> if(execution.getVariable("bpm_workflowDescription") == "" || execution.getVariable("bpm_workflowDescription") == null) { if(execution.getVariable("document") != null) { execution.setVariable("bpm_workflowDescription", document.name); } } if(execution.getVariable("wfcf_hasMandatoryConfirmers") == null) { execution.setVariable("wfcf_hasMandatoryConfirmers", false); } </activiti:expression> </activiti:field> </activiti:executionListener> |
Spring services inside scripts available via services.get("bean-name").method() or extending BaseScopableProcessorExtension and creating bean with necessary parent. For example:
Code Block | ||
---|---|---|
| ||
<bean name="FlowableConfirmableVersionJS" class="ru.citeck.ecos.flowable.example.FlowableConfirmableVersionJS" parent="baseJavaScriptExtension"> <property name="extensionName" value="flowableVersions" /> <property name="impl" ref="FlowableConfirmHelper" /> </bean> |
Global Execution Listeners
Interfaces for spring-bean objects for Global Execution Listeners (execute for all process definitions). All interfaces extend org.flowable.engine.delegate.ExecutionListener interface. Necessary to implement an interface and create spring-bean of interface implementation. Execution listeners will be automatically registered.
Interface | Event type |
---|---|
ru.citeck.ecos.flowable.listeners.global.GlobalStartExecutionListener | start |
ru.citeck.ecos.flowable.listeners.global.GlobalTakeExecutionListener | take |
ru.citeck.ecos.flowable.listeners.global.GlobalEndExecutionListener | end |
Global Task Listeners
Interfaces for spring-bean objects for Global Task Listeners (execute for all tasks). All interfaces extend org.flowable.engine.delegate.TaskListener interface. Necessary to implement an interface and create spring-bean of interface implementation. Task listeners will be automatically registered.
Interface | Event type |
---|---|
ru.citeck.ecos.flowable.listeners.global.GlobalCreateTaskListener | create |
ru.citeck.ecos.flowable.listeners.global.GlobalAssignmentTaskListener | assignment |
ru.citeck.ecos.flowable.listeners.global.GlobalCompleteTaskListener | complete |
ru.citeck.ecos.flowable.listeners.global.GlobalDeleteTaskListener | delete |
ru.citeck.ecos.flowable.listeners.global.GlobalAllTaskListener | all |
...
War file name | .properties file path | Parameters |
---|---|---|
flowable-admin | /flowable-admin/WEB-INF/classes/application.properties | Flowable database connection parameters spring.datasource.driver-class-name flowable.common.app.idm-url - flowable-idm application url (e.g. Local Tomcat on port 8080 - http://localhost:8080/flowable-idm) flowable.common.app.idm-admin.user - admin username flowable.common.app.idm-admin.password - admin password Rest integration API flowable.admin.app.server-config.process.server-address flowable.admin.app.server-config.cmmn.server-address flowable.admin.app.server-config.dmn.server-address flowable.admin.app.server-config.form.server-address flowable.admin.app.server-config.content.server-address |
flowable-idm | /flowable-idm/WEB-INF/classes/application.properties | Flowable database connection parameters spring.datasource.driver-class-name flowable.idm.app.admin.user-id - admin username flowable.idm.app.admin.password - admin password |
flowable-modeler | /flowable-modeler/WEB-INF/classes/application.properties | Flowable database connection parameters spring.datasource.driver-class-name flowable.common.app.idm-url - flowable-idm application url (e.g. Local Tomcat on port 8080 - http://localhost:8080/flowable-idm) flowable.modeler.app.deployment-api-url - deployment api url (e.g. http://localhost:8080/flowable-task/process-api ) |
flowable-rest | /flowable-rest/WEB-INF/classes/application.properties | Flowable database connection parameters spring.datasource.driver-class-name flowable.rest.app.admin.user-id - admin username flowable.rest.app.admin.password - admin password flowable.rest.app.create-demo-definitions - creation demo data flag |
flowable-task | /flowable-task/WEB-INF/classes/application.properties | Flowable database connection parameters spring.datasource.driver-class-name flowable.common.app.idm-url - flowable-idm application url (e.g. Local Tomcat on port 8080 - http://localhost:8080/flowable-idm) flowable.common.app.idm-admin.user - admin username flowable.common.app.idm-admin.password - admin password |