AnsweredAssumed Answered

Extend Activiti Designer v5.15

Question asked by cocojack42 on Sep 22, 2014
Latest reply on Jun 18, 2015 by rickydenhaan
I'm trying to extend the Activiti Designer.
The given instructions in the Activiti Guide use a HTTPS repository. I cannot use this because of problems with the local proxy settings. Anyways the latest deployed version is 5.14.1, but the designer Version I got from the designer-update site is Version 5.15.


To get the dependencies I've cloned the Git Repository https://github.com/Activiti/Activiti-Designer/tree/activiti-designer-5.15.0, build the parent-pom with clean install and followed the Tutorial.

This is the pom of my project:


<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>de.example</groupId>
   <artifactId>CustomServiceTasks</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <packaging>jar</packaging>
   <name>CustomServiceTasks</name>
   
   <properties>
      <activiti.designer.version>5.15.0-SNAPSHOT</activiti.designer.version>
      <activiti-version>5.16.1</activiti-version>
   </properties>

<!–    <repositories>
      <repository>
         <id>Activiti</id>
         <url>https://maven.alfresco.com/nexus/content/groups/public/</url>
      </repository>
   </repositories> –>

   <dependencies>
      <dependency>
         <groupId>org.activiti.designer</groupId>
         <artifactId>org.activiti.designer.integration</artifactId>
         <version>${activiti.designer.version}</version>
         <scope>compile</scope>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.11</version>
         <scope>test</scope>
      </dependency>
      
      <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-engine</artifactId>
         <version>${activiti-version}</version>
      </dependency>
      <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-spring</artifactId>
         <version>${activiti-version}</version>
      </dependency>
   </dependencies>

   <build>
      <plugins>
         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <source>1.6</source>
               <target>1.6</target>
               <showDeprecation>true</showDeprecation>
               <showWarnings>true</showWarnings>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
               <archive>
                  <index>true</index>
                  <manifest>
                     <addClasspath>false</addClasspath>
                     <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                  </manifest>
                  <manifestEntries>
                     <ActivitiDesigner-Extension-Name>CUSTOM TASKS</ActivitiDesigner-Extension-Name>
                  </manifestEntries>
               </archive>
            </configuration>
         </plugin>
      </plugins>
   </build>

</project>



The created Class


package de.example.customservicetasks;

import org.activiti.designer.integration.servicetask.AbstractCustomServiceTask;
import org.activiti.designer.integration.servicetask.PropertyType;
import org.activiti.designer.integration.servicetask.annotation.Help;
import org.activiti.designer.integration.servicetask.annotation.Property;
import org.activiti.designer.integration.servicetask.annotation.Runtime;

@Runtime(javaDelegateClass = "de.example.customservicetasks.STDummy")
@Help(displayHelpShort = "Echos the customerName", displayHelpLong = "Echoes the process variable customerName")
public class RuntimeJavaDelegateEchoTask extends AbstractCustomServiceTask {

  @Property(type = PropertyType.TEXT, displayName = "Prefix", required = true, defaultValue = "Customer name")
  @Help(displayHelpShort = "Provide a prefix for the echo")
  private String echoPrefix;

  /*
   * (non-Javadoc)
   *
   * @see
   * org.activiti.designer.integration.servicetask.AbstractCustomServiceTask
   * #contributeToPaletteDrawer()
   */
  @Override
  public String contributeToPaletteDrawer() {
    return "Acme Corporation";
  }

  @Override
  public String getName() {
    return "Echo customer name (javaDelegateClass)";
  }
 
  @Override
   public String getSmallIconPath() {
      System.out.println("Path" + super.getSmallIconPath());
      return "ressources/coins.png";
   }
}



package de.example.customservicetasks;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.JavaDelegate;

public class STDummy  implements JavaDelegate {

   private static final String ECHO_FORMAT = "%s: %s";

     private Expression echoPrefix;

     @Override
     public void execute(DelegateExecution execution) throws Exception {
       System.out.println(String.format(ECHO_FORMAT, echoPrefix.getValue(execution), execution.getVariable("customerName")));
     }

     public void setEchoPrefix(Expression echoPrefix) {
       this.echoPrefix = echoPrefix;
     }
}


When I open a bpmn diagram I get an error message "Argument cannot be null".
I don't know where to search for the error, because I've just copied the example.
Do you have any suggestions where I should search for the error?

lg Coco

Outcomes