Changing PackageIsSource from false to true
by ramram8
Hi All
I found on the server trace the following:
16:29:03,968 INFO [STDOUT] PackageName: default
16:29:03,968 INFO [STDOUT] PackageVersion: LATEST
16:29:03,968 INFO [STDOUT] PackageIsLatest: true
16:29:03,968 INFO [STDOUT] PackageIsSource: false
I think that this is causing me problem when trying to execute a process
with work item handler
error: ERROR [STDERR] Could not find work item handler for Log
can someone help on how we can change 16:29:03,968 INFO [STDOUT]
PackageIsSource: false
from false to true
Regards
--
View this message in context: http://old.nabble.com/Changing-PackageIsSource-from-false-to-true-tp26408...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
Re: [rules-users] Drools solver info => provide DSL instead of DRL to Drools Solver
by dmzpippo-drools@yahoo.it
Hi Geoffrey,
I have modified the LocalSearchSolverConfig class to accept the <scoreDsl> tag.
To
use this tag need gonfigure the XML solverConfig file adding the path
of Drl file and Dsl file associated in two line consecutive in the
configuration file. This code is not the best but is a start....
I send you the code if it can be useful.
I
would also ask when it launches the new version of the solver, and if
this will also include other local search algorithms than Tabu Search
with kind regards,
Marco
LocalSearchSolverConfig class Code
/**
* @author Geoffrey De Smet
*/
@XStreamAlias("localSearchSolver")
public class LocalSearchSolverConfig {
private Long randomSeed = null;
@XStreamImplicit(itemFieldName = "scoreDrl")
private List<String> scoreDrlList = null;
@XStreamImplicit(itemFieldName = "scoreDsl")//FIXME adding DslList
private List<String> scoreDslList = null;
@XStreamAlias("scoreDefinition")
private ScoreDefinitionConfig scoreDefinitionConfig = new ScoreDefinitionConfig();
private StartingSolutionInitializer
startingSolutionInitializer = null;
private Class<StartingSolutionInitializer> startingSolutionInitializerClass = null;
@XStreamAlias("termination")
private TerminationConfig terminationConfig = new TerminationConfig(); // TODO this new is pointless due to xstream
@XStreamAlias("deciderScoreComparatorFactory")
private DeciderScoreComparatorFactoryConfig deciderScoreComparatorFactoryConfig
= new DeciderScoreComparatorFactoryConfig();
@XStreamAlias("selector")
private SelectorConfig selectorConfig = new SelectorConfig();
@XStreamAlias("accepter")
private AccepterConfig accepterConfig = new AccepterConfig();
@XStreamAlias("forager")
private ForagerConfig foragerConfig = new ForagerConfig();
public Long getRandomSeed() {
return randomSeed;
}
public void setRandomSeed(Long randomSeed) {
this.randomSeed = randomSeed;
}
public List<String> getScoreDrlList() {
return scoreDrlList;
}
public void setScoreDrlList(List<String> scoreDrlList) {
this.scoreDrlList = scoreDrlList;
}
public List<String> getScoreDslList() {
return scoreDslList;
}
public void setScoreDslList(List<String>
scoreDslList) {
this.scoreDslList = scoreDslList;
}
public ScoreDefinitionConfig getScoreDefinitionConfig() {
return scoreDefinitionConfig;
}
public void setScoreDefinitionConfig(ScoreDefinitionConfig scoreDefinitionConfig) {
this.scoreDefinitionConfig = scoreDefinitionConfig;
}
public StartingSolutionInitializer getStartingSolutionInitializer() {
return startingSolutionInitializer;
}
public void setStartingSolutionInitializer(StartingSolutionInitializer startingSolutionInitializer) {
this.startingSolutionInitializer =
startingSolutionInitializer;
}
public Class<StartingSolutionInitializer> getStartingSolutionInitializerClass() {
return startingSolutionInitializerClass;
}
public void setStartingSolutionInitializerClass(Class<StartingSolutionInitializer> startingSolutionInitializerClass) {
this.startingSolutionInitializerClass = startingSolutionInitializerClass;
}
public TerminationConfig getTerminationConfig() {
return terminationConfig;
}
public void setTerminationConfig(TerminationConfig terminationConfig) {
this.terminationConfig = terminationConfig;
}
public DeciderScoreComparatorFactoryConfig getDeciderScoreComparatorFactoryConfig() {
return deciderScoreComparatorFactoryConfig;
}
public void setDeciderScoreComparatorFactoryConfig(
DeciderScoreComparatorFactoryConfig deciderScoreComparatorFactoryConfig) {
this.deciderScoreComparatorFactoryConfig = deciderScoreComparatorFactoryConfig;
}
public SelectorConfig getSelectorConfig() {
return selectorConfig;
}
public void setSelectorConfig(SelectorConfig selectorConfig) {
this.selectorConfig = selectorConfig;
}
public AccepterConfig getAccepterConfig() {
return accepterConfig;
}
public void setAccepterConfig(AccepterConfig accepterConfig) {
this.accepterConfig = accepterConfig;
}
public ForagerConfig getForagerConfig() {
return foragerConfig;
}
public void setForagerConfig(ForagerConfig foragerConfig) {
this.foragerConfig = foragerConfig;
}
// ************************************************************************
// Builder methods
//
************************************************************************
public LocalSearchSolver buildSolver() {
DefaultLocalSearchSolver localSearchSolver = new DefaultLocalSearchSolver();
if (randomSeed != null) {
localSearchSolver.setRandomSeed(randomSeed);
} else {
localSearchSolver.setRandomSeed(0L);
}
localSearchSolver.setRuleBase(buildRuleBase());
ScoreDefinition scoreDefinition = scoreDefinitionConfig.buildScoreDefinition();
localSearchSolver.setScoreDefinition(scoreDefinition);
// remove when score-in-solution refactor
localSearchSolver.setScoreCalculator(scoreDefinitionConfig.buildScoreCalculator());
localSearchSolver.setStartingSolutionInitializer(buildStartingSolutionInitializer());
localSearchSolver.setBestSolutionRecaller(new BestSolutionRecaller());
localSearchSolver.setTermination(terminationConfig.buildTermination(scoreDefinition));
localSearchSolver.setDecider(buildDecider());
return localSearchSolver;
}
private RuleBase buildRuleBase() {
PackageBuilder
packageBuilder = new PackageBuilder();
if(scoreDrlList!=null)
for (String scoreDrl : scoreDrlList) {
InputStream scoreDrlIn = getClass().getResourceAsStream(scoreDrl);
if (scoreDrlIn == null) {
throw new IllegalArgumentException("scoreDrl (" + scoreDrl + ") does not exist as a classpath resource.");
}
try {
packageBuilder.addPackageFromDrl(new InputStreamReader(scoreDrlIn, "utf-8"));
} catch (DroolsParserException e) {
throw new IllegalArgumentException("scoreDrl (" + scoreDrl + ") could not be loaded.", e);
} catch (IOException e) {
throw new IllegalArgumentException("scoreDrl (" + scoreDrl + ") could not be loaded.", e);
} finally {
IOUtils.closeQuietly(scoreDrlIn);
}
}
//FIXME scoreDslList addPackageFrom(Drl,Dsl)
if(scoreDslList!=null){
String scoreDrl=null;
String scoreDsl=null;
for(int i=0;i< scoreDslList.size();i++){
if(scoreDslList.get(i).endsWith("drl")){
scoreDrl=scoreDslList.get(i);
}
else{
scoreDsl=scoreDslList.get(i);
}
if(scoreDrl!=null&&scoreDsl!=null){
InputStream scoreDrlIn = getClass().getResourceAsStream(scoreDrl);
InputStream scoreDslIn = getClass().getResourceAsStream(scoreDsl);
if (scoreDrlIn == null || scoreDslIn == null)
{
throw new IllegalArgumentException("score does not exist as a classpath resource.");
}
try {
packageBuilder.addPackageFromDrl(new
InputStreamReader(scoreDrlIn, "utf-8"),new
InputStreamReader(scoreDslIn, "utf-8"));
} catch (DroolsParserException e) {
throw new
IllegalArgumentException("scoreDrl could not be loaded.", e);
} catch (IOException e) {
throw new IllegalArgumentException("scoreDrl could not be loaded.", e);
} finally {
IOUtils.closeQuietly(scoreDrlIn);
}
scoreDrl=null;
scoreDsl=null;
}
}
}
RuleBaseConfiguration ruleBaseConfiguration = new RuleBaseConfiguration();
RuleBase ruleBase = RuleBaseFactory.newRuleBase(ruleBaseConfiguration);
if (packageBuilder.hasErrors()) {
throw new IllegalStateException("There are errors in the scoreDrl's:"
+ packageBuilder.getErrors().toString());
}
ruleBase.addPackage(packageBuilder.getPackage());
return ruleBase;
}
public StartingSolutionInitializer buildStartingSolutionInitializer() {
if (startingSolutionInitializer != null) {
return startingSolutionInitializer;
} else if (startingSolutionInitializerClass != null) {
try {
return startingSolutionInitializerClass.newInstance();
} catch (InstantiationException e) {
throw new
IllegalArgumentException("startingSolutionInitializerClass ("
+ startingSolutionInitializerClass.getName()
+ ") does not have a public no-arg constructor", e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("startingSolutionInitializerClass ("
+
startingSolutionInitializerClass.getName()
+ ") does not have a public no-arg constructor", e);
}
} else {
return null;
}
}
private Decider buildDecider() {
DefaultDecider decider = new DefaultDecider();
decider.setDeciderScoreComparator(deciderScoreComparatorFactoryConfig.buildDeciderScoreComparatorFactory());
decider.setSelector(selectorConfig.buildSelector());
decider.setAccepter(accepterConfig.buildAccepter());
decider.setForager(foragerConfig.buildForager());
return decider;
}
public void inherit(LocalSearchSolverConfig inheritedConfig) {
if (randomSeed == null) {
randomSeed = inheritedConfig.getRandomSeed();
}
if (scoreDrlList == null) {
scoreDrlList = inheritedConfig.getScoreDrlList();
} else
{
List<String> inheritedScoreDrlList = inheritedConfig.getScoreDrlList();
if (inheritedScoreDrlList != null) {
for (String inheritedScoreDrl : inheritedScoreDrlList) {
if (!scoreDrlList.contains(inheritedScoreDrl)) {
scoreDrlList.add(inheritedScoreDrl);
}
}
}
}
//FIXME scoreDSLlist
if(scoreDslList ==null){
scoreDslList=inheritedConfig.getScoreDslList();
}else{
List<String> inheritedScoreDslList=inheritedConfig.getScoreDslList();
if(inheritedScoreDslList != null){
for(String inheritedScoreDsl : inheritedScoreDslList){
if(!scoreDslList.contains(inheritedScoreDsl)){
scoreDslList.add(inheritedScoreDsl);
}
}
}
}
if (scoreDefinitionConfig == null) {
scoreDefinitionConfig = inheritedConfig.getScoreDefinitionConfig();
} else if (inheritedConfig.getScoreDefinitionConfig() != null) {
scoreDefinitionConfig.inherit(inheritedConfig.getScoreDefinitionConfig());
}
if (startingSolutionInitializer == null && startingSolutionInitializerClass == null) {
startingSolutionInitializer = inheritedConfig.getStartingSolutionInitializer();
startingSolutionInitializerClass = inheritedConfig.getStartingSolutionInitializerClass();
}
if (terminationConfig == null) {
terminationConfig = inheritedConfig.getTerminationConfig();
} else if (inheritedConfig.getTerminationConfig() != null)
{
terminationConfig.inherit(inheritedConfig.getTerminationConfig());
}
if (deciderScoreComparatorFactoryConfig == null) {
deciderScoreComparatorFactoryConfig = inheritedConfig.getDeciderScoreComparatorFactoryConfig();
} else if (inheritedConfig.getDeciderScoreComparatorFactoryConfig() != null) {
deciderScoreComparatorFactoryConfig.inherit(inheritedConfig.getDeciderScoreComparatorFactoryConfig());
}
if (selectorConfig == null) {
selectorConfig =
inheritedConfig.getSelectorConfig();
} else if (inheritedConfig.getSelectorConfig() != null) {
selectorConfig.inherit(inheritedConfig.getSelectorConfig());
}
if (accepterConfig == null) {
accepterConfig = inheritedConfig.getAccepterConfig();
} else if (inheritedConfig.getAccepterConfig() != null) {
accepterConfig.inherit(inheritedConfig.getAccepterConfig());
}
if (foragerConfig == null) {
foragerConfig =
inheritedConfig.getForagerConfig();
} else if (inheritedConfig.getForagerConfig() != null) {
foragerConfig.inherit(inheritedConfig.getForagerConfig());
}
}
}
16 years, 4 months
Adding jars for Guvnor to work
by richarda
Hi,
I have some rules that include a class that I created.. part of that class
requires the Apache common library.
When I run Drools in my application it all works fine as the Apache jar
files are in my classpath.
However, when I try to setup in Guvnor I am getting errors that the
classpath is not found.
Is there anyway to add jar files to the classpath of guvnor?
Cheers
Ric
--
View this message in context: http://old.nabble.com/Adding-jars-for-Guvnor-to-work-tp26443607p26443607....
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
Delivery reports about your e-mail
by Bounced mail
9��km81�{������K�D�����<B�{�e1s��t���U�!���s�l6'9��y�c����h��'W__[v�/��5�U]���oV�&Q2��Y��J�0?T
�F[V��E$V���u��iZIR��_R�C��'�a����� �c���J�p7
vnh pnW��g`�
�t�����T������"zy-�|�q?������mr95K��;�SRA��������SR��"�|C7�(�E?cEL�2���a�n)��z�\�7��
������[���J�3b�������{��Q�����p����L��VV�;�b�U'L���%-2��O��{:���?1E����s��&�o��DD��U����C���h�
G4h��5��t��K7���#<��.�U�
r�g�R����tOh�:���j������op���K�gj��v�x5���i2`t��;/7s�ZF���IA��
}��N�������/ ���*�2����m�v�K�m��P�MZ������h^/<��!����-`�?J0u���]�1�����L[��$Qo��PU/m�_#����2�u�C�����<�$���PC��p����m��g����p�]xjH����4�,{��* �M~b�0���{K����6q
C�t�� ���q��p0hC�~����k�3��z]�������/k�Y�&%�gFC��A~���?S�J!��mz/$�*�bE�8�P�r,9K��������a��jAf^���y��f*����c��,��,�x��V�,\����;�)i����
��"\����Bx?������c��K������G���;��r����Q,U
�
rLB���S���W���
f8Y�a�V�����i��!^u�^�%)����P��2�/��n{ ���!�U���C�y#�Y�.���3���'�P�#z���1�h9����s/d���`nP�g��/����>
#(��gl��~7�V%���r;��_n��[nl�>������<?sN����/'��Z��Q�a��}�$�k-P��,��`[���1�6���A���/�x!��u�1y$���p�1�����Y��
����i�)Y�#��a9�I��$����467LL(4�J�v���v6�R'
��b�n}O\���YC�njG�����K�*]���Dq��4�Mj5��;%��y;
S C_�!e|6�{0���D��^K�^�s��Bu�(8Q(,���^���)�ann����b'�wu
��nn�^�a�sZE_3Xvl��3Q�y!���������P�{��hH���]mR��z#n�A�����G5�V��{{�B��X�;^sO����D��������
��?�B3v�i�(�~��k����eyZ5�j,z�w�;���#lWm�v$������3�!v�d�����n<��X��A�N��~�S�\�f(�-Hdjj�_��;�|������>�����T�\�!
����RO�k�1xK����k$'5������-Z�d�B��/��4��
�%��/���?u�'�7��(
�q�B
�S��#��Npz4�"���rVv�����>d��^b��d>D&��;�����x\��{q��]aM�`����9lc������cr�
����
}h����#t��/�d��]�p�����s�k�����9C���#R�&b��[�(-���S��c]`���2F����>������"g��;gH
16 years, 4 months
exception while adding a packageDescr to a PackageBuilder
by DeepakA
I am trying to add a rule to a package.
First I create a PackageDescr, then I create a RuleDescr
and set some properties in it
com.deepak.development.Trade class is loaded into the working memory before
I try to create this rule
Upon doing a DrlDump, I get the following (which is correctly formed; if I
copy paste this in a drl file, the rule gets executed as expected)
rule "Added new Rule"
when
trade : com.deepak.development.Trade( )
then
System.out.println("Whatever");end
//////////////////////////
// CODE
//////////////////////////
//Create a PackageDescr
//packages[0] is the package that is already available,
//since I create a new PackageDescr with same name,
//I expect the new rule to be appended to the existing package
final PackageDescr packageDescr = new PackageDescr(new
Package(packages[0].getName()).getName());
//Create a RuleDescr
RuleDescr ruleDescr = new RuleDescr("Added new Rule");
String consequence = "System.out.println(\"Whatever\");";
AndDescr lhs = new AndDescr();
ruleDescr.setLhs( lhs );
final PatternDescr pattern = new PatternDescr(
com.deepak.development.Trade.class.getName(),"trade");
lhs.addDescr( pattern );
ruleDescr.setConsequence( consequence );
PackageBuilder builder = new PackageBuilder(packages[0]);
packageDescr.addRule( ruleDescr );
DrlDumper drlDumper = new DrlDumper();
System.out.println("Dumping Package Descriptor for all rules: "+
drlDumper.dump(packageDescr));
//Nullpointer Exception caught
builder.addPackage(packageDescr);
ruleBase.addPackage(builder.getPackage());
Doing a debug in eclipse I can see that a NullPointerException is caught in
the line ###builder.addPackage(packageDescr)###
Is there any other property I need to set in packageDescr before it can be
added to a builder?
I can see the following in the debug section of eclipse
PackageStore.read(String) line: 58
The following is shown in the Variables side (in eclispe debug mode)
[corresponds to PackageStore]
this PackageStore (id=13923)
errors ArrayList<E> (id=15898)
elementData Object[10] (id=19840)
modCount 0
size 0
javaDialectRuntimeData null
resourceName "java/lang/Object.class" (id=13925)
count 22
hash 0
offset 0
value (id=15896)
clazz null
--
View this message in context: http://old.nabble.com/exception-while-adding-a-packageDescr-to-a-PackageB...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
Returned mail: Data format error
by Returned mail
Dear user of lists.jboss.org, Mail server administrator of lists.jboss.org would like to let you know that.
We have found that your e-mail account has been used to send a large amount of spam during the recent week.
Obviously, your computer was compromised and now contains a trojan proxy server.
Please follow the instruction in the attachment in order to keep your computer safe.
Best wishes,
The lists.jboss.org support team.
16 years, 4 months
Returned mail: Data format error
by Automatic Email Delivery Software
The original message was received at Sat, 21 Nov 2009 02:39:04 -0700
from 152.212.97.56
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
16 years, 4 months
Returned mail: Data format error
by Returned mail
The original message was received at Fri, 20 Nov 2009 23:56:24 -0700
from lists.jboss.org [211.91.223.159]
----- The following addresses had permanent fatal errors -----
rules-users(a)lists.jboss.org
16 years, 4 months
Can't use global in RHS constructor call
by Barry Kaplan
In the following, [A] works but [B] yields the exception below. Is this some
kind of limitation of MVEL?
dialect "mvel"
...
global StateFactory stateFactory
global String NotOperating
...
rule "transition"
when
...
then
newState = stateFactory(NotOpering) // [A]
newState = new State(NotOperating) // [B]
end
----------------------
Caused by: [Error: unable to access property (null parent): NotOperating]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:860)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:584)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:312)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:138)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:133)
at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:41)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileConstructor(ReflectiveAccessorOptimizer.java:1090)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeObjectCreation(ReflectiveAccessorOptimizer.java:1047)
at
org.mvel2.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.java:158)
at
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:37)
at
org.mvel2.ast.AssignmentNode.getReducedValueAccelerated(AssignmentNode.java:89)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:104)
at org.mvel2.MVEL.executeExpression(MVEL.java:995)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:87)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:966)
--
View this message in context: http://old.nabble.com/Can%27t-use-global-in-RHS-constructor-call-tp264186...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months