public void testCreatingTaskInstance() throws Exception {

    IProcessInstance processInstance = new HibernateProcessInstance();
    HibernateFOE foe = new HibernateFOE(processInstance);
    ITaskInstance taskInstance = msf.createTaskInstance(new TaskDefinition(), processInstance, foe);
    assertNotNull(taskInstance);
    assertEquals(processInstance, taskInstance.getProcessInstance());
    assertEquals(foe, taskInstance.getFOE());
    msf.saveObject(taskInstance);
    assertTrue(taskInstance.getTaskInstanceId().longValue() > 0);
  }
  public void testLoadSaveObjects() throws Exception {
    IProcessInstance processInstance = msf.createProcessInstance(new ProcessDefinition());
    msf.saveObject(processInstance);
    // assertTrue(HibernateStateFactory.getProcessInstances().containsValue(processInstance));

    HibernateFOE memoryFOE = new HibernateFOE(processInstance);
    ITaskInstance taskInstance =
        msf.createTaskInstance(new TaskDefinition(), processInstance, memoryFOE);

    msf.saveObject(processInstance);
    msf.saveObject(taskInstance);
    // assertTrue(MemoryStateFactory.getProcessInstances().containsValue(processInstance));
    // assertTrue(MemoryStateFactory.getTaskInstances().containsValue(taskInstance));

    msf.deleteObject(processInstance);
    msf.deleteObject(taskInstance);

    assertFalse(processInstance.getTaskInstances().contains(taskInstance));

    // assertTrue(MemoryStateFactory.getProcessInstances().containsValue(processInstance));
    // assertTrue(MemoryStateFactory.getTaskInstances().containsValue(taskInstance));

  }