use of org.jboss.qa.bpms.remote.ejb.domain.MyType in project jbpm by kiegroup.
the class EObjectVariableTest method testMyTypeProcessVariableInside.
@Test
public void testMyTypeProcessVariableInside() {
Map<String, Object> parameters = new HashMap<>();
parameters.put("myobject", new MyType("Hello World!"));
long pid = ejb.startProcess(ProcessDefinitions.OBJECT_VARIABLE, parameters);
List<VariableDesc> typeVarHistory = ejb.getVariableHistory(pid, "type");
Assertions.assertThat(typeVarHistory).isNotNull();
Assertions.assertThat(typeVarHistory.size()).isEqualTo(1);
VariableDesc typeVarLog = typeVarHistory.get(0);
Assertions.assertThat(typeVarLog.getNewValue()).isEqualTo(MyType.class.getName());
List<VariableDesc> contentVarHistory = ejb.getVariableHistory(pid, "myobject");
Assertions.assertThat(contentVarHistory).isNotNull();
Assertions.assertThat(contentVarHistory.size()).isEqualTo(1);
VariableDesc contentVarLog = contentVarHistory.get(0);
Assertions.assertThat(contentVarLog.getNewValue()).isEqualTo("MyType{text=Hello World!}");
}
use of org.jboss.qa.bpms.remote.ejb.domain.MyType in project jbpm by kiegroup.
the class ETaskContentTest method testGetTaskContentWithOwnType.
@Test
public void testGetTaskContentWithOwnType() {
MyType myObject = new MyType("my object text");
Map<String, Object> params = new HashMap<>();
params.put("myObject", myObject);
params.put("textContent", "HelloContent");
ProcessInstance pi = ejb.startAndGetProcess(ProcessDefinitions.HUMAN_TASK_WITH_OWN_TYPE, params);
Assertions.assertThat(pi).isNotNull();
Assertions.assertThat(pi.getState()).isEqualTo(ProcessInstance.STATE_ACTIVE);
List<Long> ts = ejb.getTasksByProcessInstanceId(pi.getId());
Assertions.assertThat(ts.size()).isEqualTo(1);
long taskId = ts.get(0);
ejb.start(taskId, userId);
Map<String, Object> content = ejb.getTaskInputContentByTaskId(taskId);
for (Entry<String, Object> c : content.entrySet()) {
System.out.println(c.getKey() + " : " + c.getValue());
}
Assertions.assertThat(((MyType) content.get("inputMyObject")).getText()).isEqualTo(myObject.getText());
}
use of org.jboss.qa.bpms.remote.ejb.domain.MyType in project jbpm by kiegroup.
the class ETaskParametersTest method testMapVariable.
@Test
public void testMapVariable() {
MyType myObject1 = new MyType("my object 1");
MyType myObject2 = new MyType("my object 2");
Map<String, MyType> mapVariable = new LinkedHashMap<>();
mapVariable.put("object1", myObject1);
mapVariable.put("object2", myObject2);
startProcessAndCompleteTask(ProcessDefinitions.HUMAN_TASK_WITH_DIFFERENT_TYPES, "outMapVariable", mapVariable, "mapVariable");
}
use of org.jboss.qa.bpms.remote.ejb.domain.MyType in project jbpm by kiegroup.
the class ETaskParametersTest method testCompleteTaskWithMyType.
@Test
public void testCompleteTaskWithMyType() {
MyType myObject = new MyType("my object text");
startProcessAndCompleteTask(ProcessDefinitions.HUMAN_TASK_WITH_DIFFERENT_TYPES, "outMyObject", myObject, "myObject");
}
use of org.jboss.qa.bpms.remote.ejb.domain.MyType in project jbpm by kiegroup.
the class ETaskParametersTest method testCompleteTaskWithNestedType.
@Test
public void testCompleteTaskWithNestedType() {
MyType myObject = new MyType("my object text");
NestedType nestedObject = new NestedType("nested object text", myObject);
startProcessAndCompleteTask(ProcessDefinitions.HUMAN_TASK_WITH_DIFFERENT_TYPES, "outNestedObject", nestedObject, "nestedObject");
}
Aggregations