[jboss-user] [JBoss Seam] - Problem injecting drools WorkingMemory
sjmenden
do-not-reply at jboss.com
Thu Dec 7 16:30:52 EST 2006
I am following the documentation for injecting the WorkingMemory into an EJB. I know my problem is configuration, but there are no working examples specific to the documentation, so I'm having trouble:
| SEVERE: Error Rendering View[/purchase.xhtml]
| org.jboss.seam.RequiredException: In attribute requires value for component: purchaseHome.purchasingRulesMemory
| at org.jboss.seam.Component.getInstanceToInject(Component.java:1844)
| at org.jboss.seam.Component.injectFields(Component.java:1317)
| at org.jboss.seam.Component.inject(Component.java:1087)
| at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
| ...
|
components.xml
| <components xmlns:drools="http://jboss.com/products/drools">
|
| ...
|
| <drools:rule-base name="purchasingRules">
| <drools:rule-files>
| <value>purchasingRules.drl</value>
| </drools:rule-files>
| </drools:rule-base>
|
| <drools:managed-working-memory name="purchasingRulesMemory" auto-create="true" rule-base="#{purchasingRules}"/>
|
| ...
|
| </components>
|
purchasingRules.drl, located in the resources dir, but I'm copying it over to WEB-INF/classes because the docs say that the rule is looked for on the classpath
| package test.purchasing
|
| rule "Step 1"
|
| when
| s : PurchaseStatus( status == "New Request")
| then
| System.out.println("Rule Triggered!!!!!!!!!");
| System.out.println(s);
| s.setStatus("Waiting for purchase Approval.");
| s.setNextStep("Step 1");
|
| end
|
PurchaseHome.java
| ...
|
| @Name("purchaseHome")
| @LoggedIn
| public class PurchaseHome extends EntityHome<Purchase> {
|
| @In WorkingMemory purchasingRulesMemory;
|
| ...
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992092#3992092
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992092
More information about the jboss-user
mailing list