[Beginners Corner] - Drools Decision Table - NULL pointer exception when using $p
by spbryan
I'm trying to put together a POC using drools decision table in order to determine whether or not we will fully invest in the product. I am trying to set up a decision table that has a condition that iterates through values added to a cell.
Under a CONDITION column I have a row with the name of the fact followed by a row that states the field name as well as the "in" syntax. I then use the "$paren" to indicate that I want to populate values from the cells beneath (listed here with values A, B, C)
Policy
policyType in ($param)
"A", "B", "C"
When I refresh the project with the spreadsheet I get a compiler error : Error: java.lang.NullPointerException
If I try to run through the debugger, I can see a generated DRL with the syntax I am looking for:
rule "somerule"
when
Policy(policyType in ("A", "B", "C"))
then
System.out.println("rule fired");
end
What am I missing?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212636#4212636
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212636
17 years, 2 months
[JBoss AOP] - not blocking warning "may not be in your classpath"
by alexis_morelle
Hi (again),
if you read my other post, I'm in the same application.
I use the standalone JBoss AOP api.
As I said, I don't have anything else then what I give you in the console. I have many (13) lines like these. I'm sorry if it's not easy to read.
anonymous wrote : [warn] Could not find class org.eclipse.core.resources.IWorkspaceRoot that org.eclipse.emf.ecore.resource.impl.URIConverterImpl references. It may not be in your classpath and you may not be getting field and constructor weaving for this class.
| [warn] Could not find class org.eclipse.core.runtime.Platform that org.eclipse.emf.common.EMFPlugin references. It may not be in your classpath and you may not be getting field and constructor weaving for this class.
| [warn] Could not find class org.eclipse.core.runtime.Platform that org.eclipse.emf.common.EMFPlugin references. It may not be in your classpath and you may not be getting field and constructor weaving for this class.
| [warn] Could not find class org.eclipse.core.runtime.IProgressMonitor that org.eclipse.xsd.util.XSDResourceImpl references. It may not be in your classpath and you may not be getting field and constructor weaving for this class.
| [warn] Could not find class org.eclipse.core.runtime.Platform that org.eclipse.emf.common.EMFPlugin references. It may not be in your classpath and you may not be getting field and constructor weaving for this class.
| [warn] Could not find class org.apache.xerces.impl.Version that nu.xom.Builder references. It may not be in your classpath and you may not be getting field and constructor weaving for this class.
As I have no aspect referencing any of these classes, my question is the same, I'd like to know where it could come from.
Thank you by advance,
Alexis.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212626#4212626
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212626
17 years, 2 months
[Microcontainer] - Re: What is the correct time to invoke the getProperties on
by jaikiran
"alesj" wrote : The builder just builds metadata.
| Annotation's metadata population happens only in Describe state,
| as we know there that our CL exists == can do class info inspection.
|
Makes sense.
"alesj" wrote :
| I looks like you're actually trying to do what AnnotationToBeanMetaDataFactory is meant for.
After looking at the AnnotationToBeanMetadatFactory, i don't think that's what i am after. So to give you an exact idea of what i am trying to do:
I am dynamically building a bean MyBean which needs another bean MyOtherBean to be injected in it:
public class MyBean
| {
|
| // Inject information will be dynamically added, including the bean name
| // to be injected
| @Inject
| private MyOtherBean otherBean;
| ...
| }
|
The easy way to dynamically build this bean and add the injection attributes is this:
| MyBean mybean = new MyBean();
| BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("blah", mybean.getClass().getName());
| builder.setConstructorValue(mybean);
|
| // create the inject attributes
| ValueMetaData inject = builder.createInject("beanNameOftheDependency", null, null, ControllerState.DESCRIBED);
| builder.addPropertyMetaData("otherBean", inject);
Works fine. However, the thing that i want to avoid is this line:
builder.addPropertyMetaData("otherBean", inject)
I was trying to avoid adding the inject/depends on a "field name" and instead was trying to see if i could create the metadata based on the "type" to inject. Something like:
builder.addPropertyMetadata(MyOtherBean.class.getName(),inject);
The MC would then look for a field of type MyOtherBean and create the injection on MyBean.
So if tomorrow, someone dislikes the field name and changes it to:
public class MyBean
| {
|
| // Inject information will be dynamically added, including the bean name
| // to be injected
| @Inject
| private MyOtherBean iDontLikeTheEarlierName;
| ...
| }
then i could still have this entire thing working.
Maybe MC already has something to achieve this and i am not finding the correct API?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212615#4212615
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212615
17 years, 2 months