Updating declared fact type in runtime causes error when calling getProcessInstance method in JBoss BRMS 5.3.x

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Enterprise Business Rules Management System Platform (BRMS) 5.3.x

Issue

After updating a declared fact type (i.e. adding a field) which is being used as a process variable in runtime, an error is experienced by trying to get this process (by executing getProcessInstance method):

Error:500 returned for /xx-tasklist/tasklist/showUserActivities.do with message IOException while loading process instance: tests.Test; local class incompatible: stream classdesc serialVersionUID = 5623444253229333709, local class serialVersionUID = -4706996429408865876
  • How can we update declared fact type in runtime?
  • Is there a way to implement a fixed version ID in declarative models? So that it can be updated in runtime.

Resolution

It has been added to JBoss BRMS/BPM Suite 6, basically a serial version id is fixed when creating a data modeler:

  static final long serialVersionUID = 1L 

In BRMS 5.3.1, a workaround is to use POJO model since you can define a fixed serial version ID and so the JVM will not calculate it based in methods or fields.

However you have to keep in mind that changing rules, facts or any asset used by a process in runtime while a process is running can be dangerous, since in that updates fields used by instances running in the process or rules can be affected.

Root Cause

When a declared fact is used as process variable your instance is serialized with the process. If you have an update in that class definition the deserialization process of that fact instance will try to match their class version ID, which will fail.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.