Is there any way to get Drools flow to use the GroovyClassLoader to load Groovy classes?  I am trying the following unsuccessfully.

 

Setting the GroovyClassLoader

GroovyClassLoader gcl = new GroovyClassLoader();

gcl.addClasspath("c:\\temp\\");  //the  com.datacert.apps.sampleapplication.models.Person  Groovy class is in c:\temp

KnowledgeBuilderConfiguration conf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, gcl);

 

KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(conf);

 

 

Flow Definition

RuleFlowProcessFactory factory = RuleFlowProcessFactory.createProcess(_processName);

int nodeCount = 1;

factory.name("Migration Approval Flow").version("1.0").packageName("com.datacert").variable("entity",

                new ObjectDataType("com.datacert.apps.sampleapplication.models.Person")).variable("entityId",

                new ObjectDataType(String.class.getCanonicalName())).variable("currentApproverName",

               

               

Runtime error in JBoss          

10:55:17,982 ERROR [[WorkflowServer]] Servlet.service() for servlet WorkflowServer threw exception

com.datacert.core.common.exception.BaseApplicationException: org.drools.RuntimeDroolsException: Unable to resolve class 'com.datacert.apps.sampleapplication.models.Person' for identifier 'entity

                at com.datacert.core.operations.service.impl.OperationService.invokeOperation(OperationService.java:57)

                at com.datacert.core.presentation.presenter.impl.ScreenPresenter.performOperation(ScreenPresenter.java:521)

                at com.datacert.core.presentation.presenter.impl.ScreenPresenter.performOperation(ScreenPresenter.java:483)

                at com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRenderController.performOperation(ItemScreenRenderController.java:426)

                at com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRenderController.performItemScreenOperation(ItemScreenRenderController.java:112)

                at com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRenderController.performOperation(ItemScreenRenderController.java:205)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

 

 

Thanks,
Todd