Created
November 6, 2013 12:52
-
-
Save meyerdan/7335610 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DummySerializable implements Serializable { | |
private static final long serialVersionUID = 1L; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<definitions | |
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" | |
xmlns:camunda="http://activiti.org/bpmn" | |
targetNamespace="org.camunda.bpm.engine.test.enginge.test.api.runtime"> | |
<process id="testProcess"> | |
<startEvent id="theStart" /> | |
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask" /> | |
<userTask id="theTask" name="my task" /> | |
<sequenceFlow id="flow2" sourceRef="theTask" targetRef="serviceTask" /> | |
<serviceTask id="serviceTask" name="my task" camunda:class="org.camunda.bpm.engine.test.api.runtime.ReadSerializableVariableDelegate" /> | |
</process> | |
</definitions> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReadSerializableVariableDelegate implements JavaDelegate { | |
public void execute(DelegateExecution execution) throws Exception { | |
// get variable | |
execution.getVariable("serializableVar"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Deployment | |
public void testSetVariableSerializable() { | |
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess"); | |
runtimeService.setVariable(processInstance.getId(), "serializableVar", new DummySerializable()); | |
Task task = taskService.createTaskQuery().singleResult(); | |
taskService.complete(task.getId()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment