[rules-users] Drools Planner - StrengthWeightFactoryClass

2011-11-04 Thread Aditya
I have declared a strengthweightfactoryclass for a planning variable. But
when I run the solver it never seems to be called. Am I missing something. I
have already declared a annotation in the get method of the planning
variable.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Planner-StrengthWeightFactoryClass-tp3480609p3480609.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] OptionalDataException while running sample mortagage example

2011-03-11 Thread Aditya
HI All,

I am providing the changeset.xml which was not pasted properly earlier







and i using Drools 5.1 server and Guvnor 5.1
Let me know if any more information required.

Regards,
Aditya


--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/OptionalDataException-while-running-sample-mortagage-example-tp2661626p2664061.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] OptionalDataException while running sample mortagage example

2011-03-10 Thread Aditya
HI 

just repasting the changeset.xml :








--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/OptionalDataException-while-running-sample-mortagage-example-tp2661626p2661633.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] OptionalDataException while running sample mortagage example

2011-03-10 Thread Aditya
HI,



I had downloaded the drools 5.1 examples which is present in
http://www.jboss.org/drools/downloads.html url

and trying to run drools-examples-brms\ mortgage-example by following all
the steps listed in the how-to document But as RuleAgent is depricated I
changed it to KnowledgeAgent and used ChangeSet.xml to provide the URL and
authentication details

When I started running the application(FinalTest.java) I was getting the
followign error:
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage  

  at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:664)

  at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:889)

  at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704)

  at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584)

  at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)

  at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)

  at FinalTest.main(FinalTest.java:25)

Caused by: java.io.OptionalDataException

  at java.io.ObjectInputStream.readObject0(Unknown Source)

  at java.io.ObjectInputStream.readObject(Unknown Source)

  at
org.drools.rule.JavaDialectRuntimeData.readExternal(JavaDialectRuntimeData.java:167)

 
The code used is as follows:
FinalTest.java:
/**
 * 
 */


import org.drools.KnowledgeBase;
import org.drools.agent.KnowledgeAgent;
import org.drools.agent.KnowledgeAgentFactory;
import org.drools.builder.ResourceType;
import org.drools.definition.type.FactType;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatelessKnowledgeSession;

/**
 * @author aditya.madhav.k
 *
 */
public class FinalTest {

/**
 * @param args
 */
public static void main(String[] args) throws InstantiationException,
IllegalAccessException{
// TODO Auto-generated method stub

KnowledgeAgent ka = 
KnowledgeAgentFactory.newKnowledgeAgent("MyAgent"); 
   
ka.applyChangeSet(ResourceFactory.newClassPathResource("changeset.xml")); 
KnowledgeBase kb = ka.getKnowledgeBase(); 
FactType appType = kb.getFactType("mortgages", "LoanApplication"); 
FactType incomeType = kb.getFactType("mortgages", "IncomeSource"); 

Object application = appType.newInstance(); 
Object income = incomeType.newInstance(); 

appType.set(application, "amount", 25000); 
appType.set(application, "deposit", 1500); 
appType.set(application, "lengthYears", 20); 

incomeType.set(income, "type", "Job"); 
incomeType.set(income, "amount", 65000); 

StatelessKnowledgeSession ks = kb.newStatelessKnowledgeSession(); 

ks.execute( new Object[] {application, income} ); 

}

}

and changeset.xml code is:

 
- 
- 
   
  
  

If anyone knows a solution for this kindly share the same



--
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/OptionalDataException-while-running-sample-mortagage-example-tp2661626p2661626.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drl to Xml conversion

2011-01-12 Thread ADITYA CHITRE
Hi,

I am trying to convert a drl file to an xml file using drool xml language. In 
there a way to convert the drool fusion operators (temporal) from the drl file 
to an xml equivalent? For eg. the time information (3m30s, 4m) in the fusion 
temporal operator "before[ 3m30s, 4m ]" is being ignored when the xml 
conversion is done. Is it possible to preserve this time information using xml 
drool api's?

Regards,
Aditya

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Updated rules recovery from rule engine

2010-12-14 Thread aditya chitre
Hi All,

We are using drl files to load the rules in the rules engine. In our
application, we can dynamically add, modify and delete rules from the rules
engine. Is it possible to get these updated rules back into a text file from
the rules engine using java?

Regards,
Aditya
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users