public void testCreateProcessInstance() {
    VariableDefinition schemaVar = new VariableDefinition();
    schemaVar.setName("sv");
    schemaVar.setType(type);
    Scope globalScope = process.getGlobalScope();
    globalScope.addVariable(schemaVar);

    QName messageName = new QName("md");
    Message messageDef = new MessageImpl();
    messageDef.setQName(messageName);
    ImportsDefinition imports = process.getImports();
    imports.addMessage(messageDef);

    VariableDefinition messageVar = new VariableDefinition();
    messageVar.setName("mv");
    messageVar.setType(imports.getMessageType(messageName));
    globalScope.addVariable(messageVar);

    // save objects and load them back
    process = saveAndReload(process);

    // verify retrieved object
    process.createProcessInstance();
  }
  public void testVariable() {
    // prepare persistent objects
    // variable
    VariableDefinition variable = new VariableDefinition();
    variable.setName("v");
    // process
    process.getGlobalScope().addVariable(variable);
    // replier
    replier.setVariable(variable);

    // save objects and load them back
    process = saveAndReload(process);
    replier = getReplier(process);

    // verify the retrieved objects
    assertEquals("v", replier.getVariable().getName());
  }