Helper to Setup Environment for Demo Use Cases
As this dependency to your project (available via Maven Central to avoid problems with building demos/showcases):
<dependency>
<groupId>com.camunda.consulting.util</groupId>
<artifactId>camunda-util-demo-support</artifactId>
<version>0.4.3</version>
</dependency>
Now you can do a couple of things in a @PostDeploy hook of a process application:
@ProcessApplication
public class MyProcessApplication extends ServletProcessApplication {
@PostDeploy
public void setupEnvironmentForDemo(ProcessEngine engine) {
LicenseHelper.setLicense(engine);
DataGenerator.createDefaultUsers(engine);
addUser(engine, "ben", "ben", "Ben", "Brooks");
addGroup(engine, "clerk", "Clerk", "ben");
addFilterGroupAuthorization(engine, "clerk", FILTER_myTasks, FILTER_groupTasksFilter, FILTER_allTasksFilter);
addUser(engine, "lisa", "lisa", "Lisa", "Floyd");
addGroup(engine, "management", "Management", "lisa");
addFilterUserAuthorization(engine, "lisa", FILTER_myTasks, FILTER_groupTasksFilter, FILTER_allTasksFilter);
createGrantGroupAuthorization(engine, //
new String[] { "clerk" }, //
new Permission[] { Permissions.READ, Permissions.READ_HISTORY, Permissions.UPDATE_INSTANCE }, //
Resources.PROCESS_DEFINITION, //
new String[] { "insurance-application" });
See InsuranceProcessApplication for an example of using it.
Features
Now the process application will automatically:
- Set a license found in USER-HOME/.camunda/build.properties
- Create default user "admin" and group "management"
- Create users & groups as specified (if not already existant)
- Set the password of created users to the password given + a suffix read from USER-HOME/.camunda/build.properties
Configuration
In order to configure the util create a file USER-HOME/.camunda/build.properties:
camunda.license=...(your camunda ee license key)...
camunda.password.suffix=MySecret
Environment Restrictions
You need Camunda BPM 7.4.0-alpha2 onwards