Skip to main content

Workflows Importer

The Workflows Importer tool allows you to import the runtime workflow configuration from your (live) database and convert it to the workflows metamodel.

Instructions

  1. Add the metamodel to the expansionResources of your application.
    conf/expansionResources.xml
    <expansionResources>
    <expansionResource name="net.democritus.workflow:workflow-model-stack" version="1.7.0"/>
    </expansionResources>
  2. Create a configuration file indicating how to access your database.
    conf/workflows-importer.properties
       jdbc.connectionString=jdbc:postgresql://localhost:5432/yourapp
    jdbc.username=username # default: postgres
    jdbc.password=password # default: postgres

    # Table names are all optional
    tables.workflow=WORKFLOW.WORKFLOW
    tables.engineService=WORKFLOW.ENGINESERVICE
    tables.stateTask=WORKFLOW.STATETASK
    tables.timeWindowGroup=WORKFLOW.TIMEWINDOWGROUP
    tables.user=ACCOUNT.USER
  3. Download the tool from Nexus.
    mvn dependency:copy "-Dartifact=net.democritus.tools:workflows-importer:1.3.0:jar" "-DoutputDirectory=."
  4. Perform the import. All three arguments are optional.
    java -jar workflows-importer-1.3.0.jar
    [expansionSettings] # default: conf/expansionSettings.xml
    [configuration] # default: conf/workflows-importer.properties
    [targetDirectory] # default: expansionSettings.modelDirectory

Using other database drivers

The tool is packaged with the postgres JDBC driver. If you want to import workflows from another type of database, you will need to add its JDBC driver to the classpath.

Take MariaDB as an example, you would add their org.mariadb.jdbc:mariadb-java-client driver:

mvn dependency:copy "-Dartifact=org.mariadb.jdbc:mariadb-java-client:$VERSION:jar" -DoutputDirectory="."
java -classpath mariadb-java-client-$VERSION.jar -jar workflows-importer-1.3.0.jar