09-22-2014 08:27 AM
<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>
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;
}
}
03-26-2015 03:51 PM
04-07-2015 06:31 AM
06-18-2015 01:10 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.