Package org.activiti.engine.test.history

Examples of org.activiti.engine.test.history.SerializableVariable


    assertEquals(processInstance.getId(), dateVariable.getProcessInstanceId());
    assertEquals(updatedDate, dateVariable.getTime());
   
    HistoricVariableUpdate serializableVariable = (HistoricVariableUpdate) details.get(7);
    assertEquals("gVariable", serializableVariable.getVariableName());
    assertEquals(new SerializableVariable("hello hello"), serializableVariable.getValue());
    assertEquals(processInstance.getId(), serializableVariable.getProcessInstanceId());
    assertEquals(updatedDate, serializableVariable.getTime());
   
    HistoricVariableUpdate byteArrayVariable = (HistoricVariableUpdate) details.get(8);
    assertEquals("hVariable", byteArrayVariable.getVariableName());
    assertEquals(";-)", new String((byte[])byteArrayVariable.getValue()));
    assertEquals(processInstance.getId(), byteArrayVariable.getProcessInstanceId());
    assertEquals(updatedDate, byteArrayVariable.getTime());
   
    // end process instance
    List<Task> tasks = taskService.createTaskQuery().list();
    assertEquals(1, tasks.size());
    taskService.complete(tasks.get(0).getId());
    assertProcessEnded(processInstance.getId());
   
    // check for historic process variables set
    HistoricVariableInstanceQuery historicProcessVariableQuery = historyService
            .createHistoricVariableInstanceQuery()
            .orderByVariableName().asc();
   
    assertEquals(8, historicProcessVariableQuery.count());
   
    List<HistoricVariableInstance> historicVariables = historicProcessVariableQuery.list();
   
// Variable status when process is finished
    HistoricVariableInstance historicVariable = historicVariables.get(0);
    assertEquals("aVariable", historicVariable.getVariableName());
    assertEquals("updated value", historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(1);
    assertEquals("bVariable", historicVariable.getVariableName());
    assertEquals(123, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(2);
    assertEquals("cVariable", historicVariable.getVariableName());
    assertEquals(12345L, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(3);
    assertEquals("dVariable", historicVariable.getVariableName());
    assertEquals(1234.567, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(4);
    assertEquals("eVariable", historicVariable.getVariableName());
    assertEquals((short) 12, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(5);
    assertEquals("fVariable", historicVariable.getVariableName());
    assertEquals(sdf.parse("01/01/2001 01:23:45 678"), historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(6);
    assertEquals("gVariable", historicVariable.getVariableName());
    assertEquals(new SerializableVariable("hello hello"), historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(7);
    assertEquals("hVariable", historicVariable.getVariableName());
    assertEquals(";-)", ";-)", new String((byte[])historicVariable.getValue()));
View Full Code Here


    execution.setVariable("eVariable", (short)12);
   
    Date theDate =sdf.parse("01/01/2001 01:23:45 678");
    execution.setVariable("fVariable", theDate);
   
    execution.setVariable("gVariable", new SerializableVariable("hello hello"));
    execution.setVariable("hVariable", ";-)".getBytes());
  }
View Full Code Here

    assertEquals(processInstance.getId(), dateVariable.getProcessInstanceId());
    assertEquals(updatedDate, dateVariable.getTime());
   
    HistoricVariableUpdate serializableVariable = (HistoricVariableUpdate) details.get(7);
    assertEquals("gVariable", serializableVariable.getVariableName());
    assertEquals(new SerializableVariable("hello hello"), serializableVariable.getValue());
    assertEquals(processInstance.getId(), serializableVariable.getProcessInstanceId());
    assertEquals(updatedDate, serializableVariable.getTime());
   
    HistoricVariableUpdate byteArrayVariable = (HistoricVariableUpdate) details.get(8);
    assertEquals("hVariable", byteArrayVariable.getVariableName());
    assertEquals(";-)", new String((byte[])byteArrayVariable.getValue()));
    assertEquals(processInstance.getId(), byteArrayVariable.getProcessInstanceId());
    assertEquals(updatedDate, byteArrayVariable.getTime());
   
    // end process instance
    List<Task> tasks = taskService.createTaskQuery().list();
    assertEquals(1, tasks.size());
    taskService.complete(tasks.get(0).getId());
    assertProcessEnded(processInstance.getId());
   
    // check for historic process variables set
    HistoricVariableInstanceQuery historicProcessVariableQuery = historyService
            .createHistoricVariableInstanceQuery()
            .orderByVariableName().asc();
   
    assertEquals(8, historicProcessVariableQuery.count());
   
    List<HistoricVariableInstance> historicVariables = historicProcessVariableQuery.list();
   
// Variable status when process is finished
    HistoricVariableInstance historicVariable = historicVariables.get(0);
    assertEquals("aVariable", historicVariable.getVariableName());
    assertEquals("updated value", historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(1);
    assertEquals("bVariable", historicVariable.getVariableName());
    assertEquals(123, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(2);
    assertEquals("cVariable", historicVariable.getVariableName());
    assertEquals(12345L, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(3);
    assertEquals("dVariable", historicVariable.getVariableName());
    assertEquals(1234.567, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(4);
    assertEquals("eVariable", historicVariable.getVariableName());
    assertEquals((short) 12, historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(5);
    assertEquals("fVariable", historicVariable.getVariableName());
    assertEquals(sdf.parse("01/01/2001 01:23:45 678"), historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(6);
    assertEquals("gVariable", historicVariable.getVariableName());
    assertEquals(new SerializableVariable("hello hello"), historicVariable.getValue());
    assertEquals(processInstance.getId(), historicVariable.getProcessInstanceId());
   
    historicVariable = historicVariables.get(7);
    assertEquals("hVariable", historicVariable.getVariableName());
    assertEquals(";-)", ";-)", new String((byte[])historicVariable.getValue()));
View Full Code Here

    execution.setVariable("eVariable", (short)12);
   
    Date theDate =sdf.parse("01/01/2001 01:23:45 678");
    execution.setVariable("fVariable", theDate);
   
    execution.setVariable("gVariable", new SerializableVariable("hello hello"));
    execution.setVariable("hVariable", ";-)".getBytes());
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.test.history.SerializableVariable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.