Jbpm 3814 6.0.x

The solution for both JBPM-3814 and BZ 1002724.