// if a working memory has been explicitly selected as variable, use this
if (context instanceof IVariable) {
IVariable variable = (IVariable) context;
try {
IValue value = ((IVariable) context).getValue();
if (value != null && value instanceof IJavaObject) {
if ("org.drools.core.common.AbstartWorkingMemory".equals(variable.getValue().getReferenceTypeName()) ||
"org.drools.core.reteoo.ReteooStatefulSession".equals(variable.getValue().getReferenceTypeName()) ||
// for backwards compatibility
"org.drools.reteoo.ReteooStatefulSession".equals(variable.getValue().getReferenceTypeName())) {