0 Replies Latest reply on May 21, 2007 10:43 AM by jstuck

    TaskInstance Hibernate Exception

    jstuck

      Hi:

      I am working on a UI for JBPM. When starting a ProcessInstance, I inspect the startTaskInstance for any variables that need to be supplied. However, when saving the process instance, I receive the following hibernate exception:

      instance not of expected entity type: org.jbpm.context.exe.VariableInstance

      Here is the code I am using to get the startTaskInstance:

      TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();

      I then use the taskController to gain access to the variables if they exist. This is used to construct the UI.

      TaskController taskController = taskInstance.getTask().getTaskController();

      if (taskController != null) {
      List variableAccesses = taskController.getVariableAccesses();
      Iterator iterator = variableAccesses.iterator();

      while (iterator.hasNext()) {
      VariableAccess variableAccess = (VariableAccess) iterator.next();
      String mappedName = variableAccess.getMappedName();
      String value = (String) taskInstance.getVariable(mappedName);
      ?
      }
      }

      Does anyone know why I am seeing this exception and can you recommend a solution?

      Thanks,

      Jeff