12-30-2015 02:14 AM
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="test1" name="test1" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<serviceTask id="servicetask1" name="Service Task" activiti:class="org.activiti.CustomTask"></serviceTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
</process>
</definitions>
public class CustomTask extends ReceiveTaskActivityBehavior {
private static final long serialVersionUID = 2945313111593357836L;
/*
* (non-Javadoc)
*
* @see
* org.activiti.engine.impl.bpmn.behavior.ReceiveTaskActivityBehavior#execute
* (org.activiti.engine.impl.pvm.delegate.ActivityExecution)
*/
@Override
public void execute(ActivityExecution execution) throws Exception {
Command command = new Command();
command.doSomething(execution.getEngineServices().getRuntimeService(), execution);
}
/*
* (non-Javadoc)
*
* @see
* org.activiti.engine.impl.bpmn.behavior.ReceiveTaskActivityBehavior#signal
* (org.activiti.engine.impl.pvm.delegate.ActivityExecution,
* java.lang.String, java.lang.Object)
*/
@Override
public void signal(ActivityExecution execution, String signalName, Object data) throws Exception {
//Fails here
Assert.assertEquals(data != null, true);
leave(execution);
}
}
public class Command {
public void doSomething(RuntimeService runtimeService, ActivityExecution execution) {
System.out.println("done");
//notify
Map<String, Object> signalData = new HashMap<String, Object>();
runtimeService.signal(execution.getId(), signalData);
}
}
12-30-2015 06:06 AM
12-30-2015 12:16 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.