cancel
Showing results for 
Search instead for 
Did you mean: 

Extend Activiti Designer v5.15

cocojack42
Champ in-the-making
Champ in-the-making
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
3 REPLIES 3

miere_teixeira
Champ in-the-making
Champ in-the-making
I'm facing the same problem here.
Is there any workaround to fix this issue?

Regards
Miere

cocojack42
Champ in-the-making
Champ in-the-making
Well this is actually not realy a solution, but you can pull the git, and start the activiti designer from your workspace.
You end up with two different instances of Eclipse, but it works… Maybe this will help you.

rickydenhaan
Champ in-the-making
Champ in-the-making
I've faced a similar issue (but with a different exception) and the solution proposed by cocojack42 has worked fine enough for my use case.

There is a nice step-by-step guide on how to build this development environment here –> http://blog.sina.com.cn/s/blog_72ef7bea0102vmt2.html
This guide is kind of made from the information provided by the Activiti forums user "peilers" in this post –> http://forums.activiti.org/content/eclipse-plug-unable-instantiate-class-orgactivitidesignereclipsee...

I had to downgrade to eclipse Juno to make this happen, sadly. I hade issues with some modeler plugins in Kepler.