Skip to content

Instantly share code, notes, and snippets.

View estebanroblesluna's full-sized avatar

Esteban Robles Luna estebanroblesluna

View GitHub Profile
public class NeedsApprovalDelegate implements org.activiti.engine.delegate.JavaDelegate
{
private static Set<String> imagesWithCopyright = new HashSet<String>();
static {
imagesWithCopyright.add("mule1.jpg");
imagesWithCopyright.add("mule2.jpg");
}
@WebService(endpointInterface = "com.picturerequest.ChargeService", serviceName = "ChargeService")
public class ChargeServiceImpl implements ChargeService
{
public String chargeAccount(String username, String imageName)
{
//do some stuff to charge the username
return imageName;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<definitions
id="definitions"
targetNamespace="http://activiti.org/bpmn20"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn">
<process
id="pictureRequest"
public class ChargeDelegate implements org.activiti.engine.delegate.JavaDelegate
{
private Expression wsdl;
private Expression operation;
private Expression parameters;
private Expression returnValue;
public void execute(DelegateExecution execution) throws Exception
{
String wsdlString = (String) wsdl.getValue(execution);
<ajax:endpoint name="ajax-endpoint" channel="/requestCharged"/>
<flow name="chargeAccount">
<inbound-endpoint address="http://localhost:8291/chargeService" />
<cxf:jaxws-service serviceClass="com.picturerequest.ChargeServiceImpl" />
<component class="com.picturerequest.ChargeServiceImpl" />
<outbound-endpoint ref="ajax-endpoint" exchange-pattern="one-way"/>
</flow>
<target name="evaluateActivitiModule" depends="activiti.stopCleanAndStart, activiti.deployMultiplier">
<exec executable="sleep" failifexecutionfails="false" failonerror="false">
<arg value="30" />
</exec>
<exec dir="${activiti.module.home}" executable="mvn" failifexecutionfails="false" failonerror="false">
<arg value="clean" />
<arg value="install" />
<arg value="-Dactiviti.version=${activiti.version}" />
</exec>
<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>
<activiti:connector name="activitiServer" version="5.5"
repositoryService-ref="repositoryService"
runtimeService-ref="runtimeService"
taskService-ref="taskService"
historyService-ref="historyService" />
<flow name="create-process">
<vm:inbound-endpoint path="in" exchange-pattern="request-response" />
<activiti:create-process parametersExpression="#[header:INBOUND:createProcessParameters]" />
</flow>
<spring:bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
<spring:property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
<spring:property name="jdbcDriver" value="org.h2.Driver" />
<spring:property name="jdbcUsername" value="sa" />
<spring:property name="jdbcPassword" value="" />
<spring:property name="databaseSchemaUpdate" value="true" />
<spring:property name="jobExecutorActivate" value="false" />
</spring:bean>
<spring:bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">