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();
  }
 protected VariableType getVariableType(ImportsDefinition imports) {
   return imports.getElementType(ELEMENT_NAME);
 }