Version warning

The content below is for Apache Syncope 1.2 - for later versions the Reference Guide is available.

Rationale

Due to licensing issues - see this comment for more information - it is not possible to embed Activiti Modeler, which provides a powerful graphical web editing interface for Activiti workflow, into any Apache Syncope artifact; thus, some manual steps are required to enable it on a working Apache Syncope environment.

Steps

This procedure requires Apache Maven to be available on the host where Apache Syncope console will be run since it is using a fake project to perform all required setup tasks.

Identify the Activiti version for Apache Syncope

Read release notes for your own Syncope version: for example, Apache Syncope 1.2.0-M1 ships with Activiti 5.16.2.

Identify the directory where Activiti Modeler will be deployed

This is the directory where Activiti Modeler will be run from: it needs to reside on the same physical host where Apache Syncope console will be run.

This is the same directory defined in Syncope's console.properties.

Obtain a copy of TokenValue map

You can download it from the source repository

Run the fake Maven project

Create a file named pom.xml in an empty directory of the same physical host where Apache Syncope console will be run with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  
  <groupId>org.apache.syncope</groupId>
  <artifactId>activitiModelerSetup</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  
  <properties>
    <activiti.version>5.16.2</activiti.version>
    <activiti-modeler.directory>XXXXXXX</activiti-modeler.directory>
    <tokenValueMap>YYYYYYYYYYY/oryx.debug.js-tokenValueMap.properties</tokenValueMap>
    
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>org.activiti</groupId>
      <artifactId>activiti-webapp-explorer2</artifactId>            
      <version>${activiti.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>    
  </dependencies>
  
  <build>    
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>setupActivitiModeler</id>
            <phase>process-resources</phase>
            <configuration>
              <target>
                <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war" 
                       dest="${project.build.directory}/activiti-webapp-explorer2" />
                
                <mkdir dir="${activiti-modeler.directory}" />
                
                <mkdir dir="${activiti-modeler.directory}/editor" />
                <copy todir="${activiti-modeler.directory}/editor">
                  <fileset dir="${project.build.directory}/activiti-webapp-explorer2/editor">
                    <exclude name="oryx.js" />
                  </fileset>
                </copy>
                <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml" 
                      todir="${activiti-modeler.directory}/editor" />
                <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json" 
                      todir="${activiti-modeler.directory}/editor" />
                
                <mkdir dir="${activiti-modeler.directory}/explorer" />
                <copy todir="${activiti-modeler.directory}/explorer">
                  <fileset dir="${project.build.directory}/activiti-webapp-explorer2/explorer" />
                </copy>
                
                <mkdir dir="${activiti-modeler.directory}/libs" />
                <copy todir="${activiti-modeler.directory}/libs">
                  <fileset dir="${project.build.directory}/activiti-webapp-explorer2/libs" />
                </copy>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>1.5.3</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>replace</goal>
            </goals>                   
          </execution>
        </executions>
        <configuration>
          <file>${activiti-modeler.directory}/editor/oryx.debug.js</file>
          <tokenValueMap>${tokenValueMap}</tokenValueMap>
          <unescape>true</unescape>
          <regex>false</regex>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Fill the XML elements under <properties> with the elements identified above (where XXXXXXX is the path to a directory to be created and YYYYYYYYYYY is the directory where you have placed the file oryx.debug.js-tokenValueMap.properties), then run

mvn clean package

this will download Activiti Modeler and adapt the configuration to work with Apache Syncope console.

At this point you will need to adjust the activitiModelerDirectory property in console.properties to point to the YYYYYYYYYYY set above.

Restart the Java EE container

Now that modifications have been made, restart the Java EE container where the Syncope console is deployed to make it aware of changes.

  • No labels