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")).var
iable("entityId",
new
ObjectDataType(String.class.getCanonicalName())).variable("currentApprov
erName",
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.invokeOperati
on(OperationService.java:57)
at
com.datacert.core.presentation.presenter.impl.ScreenPresenter.performOpe
ration(ScreenPresenter.java:521)
at
com.datacert.core.presentation.presenter.impl.ScreenPresenter.performOpe
ration(ScreenPresenter.java:483)
at
com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRende
rController.performOperation(ItemScreenRenderController.java:426)
at
com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRende
rController.performItemScreenOperation(ItemScreenRenderController.java:1
12)
at
com.datacert.core.presentation.controller.springmvc.impl.ItemScreenRende
rController.performOperation(ItemScreenRenderController.java:205)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
Thanks,
Todd
Show replies by date