[rules-users] Dynamic facts

2011-07-18 Thread Marc Heinz
Hello everyone,

I need some enlightening about Drools "dynamic facts" (a term used in the
documentation, for facts that could be updated from outside the rule
engine).

The current documentation always list the "insert" method of a
StatefulKnowledgeSession being able to take an additional boolean
argument, stating that the corresponding fact supports the
PropertyChangeSupport related methods.

However, it seems that this method do not exists anymore for already some
time now...

After googling for a while it appears that some possible workaround were
modifyInsert (apparently removed from the API as well) and the
@propertyChangeSupport meta-data annotation, but I didn't manage to make
it work (actually I wasn't able to find any reference from it in the API,
so I guess that it is also not available anymore).

So, this left us with the "session.update" method. Which seems to works
great, except that it will invalidate the whole fact into the working
memory, even if only some of the fields were changed.

Is this some current limitation of Drools? Does it have something to do
with those "Shadows Fact"? (that would be somehow immutable?)

If we effectively can't fire update targeted to some specific fields, this
has probably some big implications on performances (even for simple fact
with only a few fields). It would also means that one should always aim at
the finest granularity for better performances, by somehow "flattening"
the object structure into the knowledge base (which in turn could make
complicated to reuse those same Pojo in other frameworks, such as
hibernate).

Did I miss something?

Any feedback deeply appreciated,

Thanks!

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


[rules-users] concurrent modification of a rule by more than one user in Guvnor

2011-07-18 Thread puja nandamuri
Hi All,

I am currently testing 5.2.0.CR1 version of Guvnor. 


Can multiple users modify a rule in Guvnor at the same time? what are the 
issues involved in say, two users trying to change 

1. the same row in a decision Table at the same time and saving it.

2. different rows in a decision table at the same time and saving it.

Are there any documentation or articles to get more information on concurrent 
access within Guvnor?

Thank You,

ram.

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


Re: [rules-users] jaxb generated fact loaded into Guvnor throws errors when using the ' is contained in the comma separated list' operator

2011-07-18 Thread Sreeram.Vadlamudi
Hi Mike,

Thank You for your responses.

My apologies.

I did miss copying the closing bracket.the issue still exists though . I 
suspect whether the way the code has been generated by jaxb has anything to do 
with it.

In the xml, the field is all upper case as


I see that JAXB generated the code as follows.

@XmlElement(name = "ACTIVITYCODE", required = true)
protected String activitycode;

  /**
 * Gets the value of the activitycode property.
 *
 * @return
 * possible object is
 * {@link String }
 *
 */
public String getACTIVITYCODE() {
return activitycode;
}

/**
 * Sets the value of the activitycode property.
 *
 * @param value
 * allowed object is
 * {@link String }
 *
 */
public void setACTIVITYCODE(String value) {
this.activitycode = value;
}

rule "Row 1 dds"
   ruleflow-group "None"
   dialect "mvel"
when
factClass : FACTCLASS( ACTIVITYCODE in ("A", "B"))



From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Monday, July 18, 2011 2:15 PM
To: Rules Users List
Subject: Re: [rules-users] jaxb generated fact loaded into Guvnor throws errors 
when using the ' is contained in the comma separated list' operator

Unless you have copied and pasted incorrectly, the rule should read:-
3.  |   rule "Row 1 dds"
4.  |   ruleflow-group "None"
5.  |   dialect "mvel"
6.  |   when
7.  |   factClass : FACTCLASS( ACTIVITYCODE in ("A", "B") ) 
\\<0--- note closing bracket
8.  |   then
9.  |   factClass.setRATE( "5.25" );
10. |   end

On 18 July 2011 20:57, Michael Anstis 
mailto:michael.ans...@gmail.com>> wrote:
There is a closing bracket missing in the generated DRL.

This is a bug. Please raise a JIRA and assign to me and I'll fix for 
5.3.0.Beta1.

With kind regards,

Mike
2011/7/14 
mailto:sreeram.vadlam...@wellsfargo.com>>
Hello ,

I am using 5.2.0.CR1 version of Guvnor .

I have a jaxb generated class loaded through the model jar into Guvnor to be 
used as a fact in the Guided Decision Table editor.

When I use a field ACTIVITYCODE  of type String from the JAXB generated class  
with  ' is contained in the comma separated list'  operator, I get compilation 
errors.

Unable to Analyse Expression ACTIVITYCODE == "A" || ACTIVITYCODE == "B": 
[Error: no such identifier: ACTIVITYCODE] [Near : {... ACTIVITYCODE == "A" || 
ACTIVI }] ^ [Line: 1, Column: 1]

But when I use equal to operator to compare value to just a string value, it 
compiles fine.

This rule fails.

3.  |   rule "Row 1 dds"
4.  |   ruleflow-group "None"
5.  |   dialect "mvel"
6.  |   when
7.  |   factClass : FACTCLASS( ACTIVITYCODE in ("A", "B")
8.  |   then
9.  |   factClass.setRATE( "5.25" );
10. |   end

The below rule compiles fine.


3.  |   rule "Row 1 dds"
4.  |   ruleflow-group "None"
5.  |   dialect "mvel"
6.  |   when
7.  |   factClass : FACTCLASS ( ACTIVITYCODE =="A")
8.  |   then
9.  |   factClass.setRATE( "5.25" );
10. |   end

Is this issue being caused by jaxb generated class? If so, is there a way to 
fix this problem?

When I use a regular pojo that is not jaxb generated, the

is contained in the comma separated list'  operator works fine.

Can someone provide any direction or thoughts on this?

Thanks,

Ram





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


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


Re: [rules-users] jaxb generated fact loaded into Guvnor throws errors when using the ' is contained in the comma separated list' operator

2011-07-18 Thread Michael Anstis
Unless you have copied and pasted incorrectly, the rule should read:-

3.  |   rule "Row 1 dds"
4.  |   ruleflow-group "None"
5.  |   dialect "mvel"
6.  |   when
7.  |   factClass : FACTCLASS( ACTIVITYCODE in ("A", "B") *)
\\<0--- note closing bracket*
8.  |   then
9.  |   factClass.setRATE( "5.25" );
10. |   end


On 18 July 2011 20:57, Michael Anstis  wrote:

> There is a closing bracket missing in the generated DRL.
>
> This is a bug. Please raise a JIRA and assign to me and I'll fix for
> 5.3.0.Beta1.
>
> With kind regards,
>
> Mike
>
> 2011/7/14 
>
>>  Hello ,
>>
>> I am using 5.2.0.CR1 version of Guvnor .
>>
>> I have a jaxb generated class loaded through the model jar into Guvnor to
>> be used as a fact in the Guided Decision Table editor.
>>
>> When I use a field ACTIVITYCODE  of type String from the JAXB generated
>> class  with  ‘ is contained in the comma separated list'  operator, I get
>> compilation errors.
>>
>> Unable to Analyse Expression ACTIVITYCODE == "A" || ACTIVITYCODE == "B":
>> [Error: no such identifier: ACTIVITYCODE] [Near : {... ACTIVITYCODE == "A"
>> || ACTIVI }] ^ [Line: 1, Column: 1]
>>
>> But when I use equal to operator to compare value to just a string value,
>> it compiles fine.
>>
>> This rule fails.
>>
>> *3.  *|   rule "Row 1 dds"
>> 4.  |   ruleflow-group "None"
>> 5.  |   dialect "mvel"
>> 6.  |   when
>> 7.  |   factClass : FACTCLASS( ACTIVITYCODE in ("A", "B")
>> 8.  |   then
>> 9.  |   factClass.setRATE( "5.25" );
>> 10. |   end
>>
>> The below rule compiles fine.
>>
>>
>> *3.  *|   rule "Row 1 dds"
>> 4.  |   ruleflow-group "None"
>> 5.  |   dialect "mvel"
>> 6.  |   when
>> 7.  |   factClass : FACTCLASS ( ACTIVITYCODE =="A")
>> 8.  |   then
>> 9.  |   factClass.setRATE( "5.25" );
>> 10. |   end
>>
>> Is this issue being caused by jaxb generated class? If so, is there a way
>> to fix this problem?
>>
>> When I use a regular pojo that is not jaxb generated, the
>>
>> is contained in the comma separated list'  operator works fine.
>>
>> Can someone provide any direction or thoughts on this?
>>
>> Thanks,
>>
>> Ram
>>
>>
>>
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] priority based on object properties

2011-07-18 Thread Simon Chen
But here comes another problem...

I used "salience (-$path.cost)" in the rule for propagating current
shortest paths on a node to neighboring nodes. At first, it worked
great, as in the log I see routes with smaller costs being propagated.
But later on, I see the progress slowing down quite a bit. My guess is
that the sorting based on (-$path.cost) takes longer and longer as the
number of objects increases - now my java process takes about 8GB of
memory.

One idea is to use some sort of bucketing, such that I duplicate the
propagation rule from one to, for example, five, and each of the five
rules would be applied on a subset of the paths with a particular
range of costs. This might work, but has the downside of needing the
input of some data statistics (for proper bucketing, for example.)

Any ideas on this?

Thanks.
-Simon

On Mon, Jul 18, 2011 at 4:07 PM, Simon Chen  wrote:
> I think it works.
>
> Actually, just found it in the current Drools expert documentation
> too. Shame on me...
>
> Thanks.
> -Simon
>
> 2011/7/18 Michael Anstis :
>> I believe this
>> http://blog.athico.com/2007/05/dynamic-salience-expressions.html still
>> works.
>>
>> On 18 July 2011 20:44, Simon Chen  wrote:
>>>
>>> Hi all,
>>>
>>> I am curious if we can inform Drools' execution based on properties
>>> within objects.
>>>
>>> In particular, the salience value is defined for each rule, in the
>>> sense that rule A has priority over rule B to execute. I am wondering
>>> if we can define some kinda of salience metric, such that object X has
>>> higher priority than object Y to be executed in the same rule.
>>>
>>> To give an example, I am (still) playing with implementing shortest
>>> path using a few rules. I have a rule for selecting a shortest path on
>>> a node (among all the paths received from its neighbors) to a source
>>> node, and another rule for propagating the shortest path on a node to
>>> neighboring nodes. When I have many nodes in my graph, I found that
>>> the paths propagated (via the second rule) are not always the
>>> shortest, while Dijkstra's algorithm always "propagate" from the node
>>> with the shortest distance to the source. The effect is that my rules
>>> are wasting most of the time propagating paths that would be dropped
>>> in the end anyway...
>>>
>>> Any ideas?
>>>
>>> Thanks.
>>> -Simon
>>> ___
>>> rules-users mailing list
>>> rules-users@lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] priority based on object properties

2011-07-18 Thread Simon Chen
I think it works.

Actually, just found it in the current Drools expert documentation
too. Shame on me...

Thanks.
-Simon

2011/7/18 Michael Anstis :
> I believe this
> http://blog.athico.com/2007/05/dynamic-salience-expressions.html still
> works.
>
> On 18 July 2011 20:44, Simon Chen  wrote:
>>
>> Hi all,
>>
>> I am curious if we can inform Drools' execution based on properties
>> within objects.
>>
>> In particular, the salience value is defined for each rule, in the
>> sense that rule A has priority over rule B to execute. I am wondering
>> if we can define some kinda of salience metric, such that object X has
>> higher priority than object Y to be executed in the same rule.
>>
>> To give an example, I am (still) playing with implementing shortest
>> path using a few rules. I have a rule for selecting a shortest path on
>> a node (among all the paths received from its neighbors) to a source
>> node, and another rule for propagating the shortest path on a node to
>> neighboring nodes. When I have many nodes in my graph, I found that
>> the paths propagated (via the second rule) are not always the
>> shortest, while Dijkstra's algorithm always "propagate" from the node
>> with the shortest distance to the source. The effect is that my rules
>> are wasting most of the time propagating paths that would be dropped
>> in the end anyway...
>>
>> Any ideas?
>>
>> Thanks.
>> -Simon
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] priority based on object properties

2011-07-18 Thread Michael Anstis
I believe this
http://blog.athico.com/2007/05/dynamic-salience-expressions.html still
works.

On 18 July 2011 20:44, Simon Chen  wrote:

> Hi all,
>
> I am curious if we can inform Drools' execution based on properties
> within objects.
>
> In particular, the salience value is defined for each rule, in the
> sense that rule A has priority over rule B to execute. I am wondering
> if we can define some kinda of salience metric, such that object X has
> higher priority than object Y to be executed in the same rule.
>
> To give an example, I am (still) playing with implementing shortest
> path using a few rules. I have a rule for selecting a shortest path on
> a node (among all the paths received from its neighbors) to a source
> node, and another rule for propagating the shortest path on a node to
> neighboring nodes. When I have many nodes in my graph, I found that
> the paths propagated (via the second rule) are not always the
> shortest, while Dijkstra's algorithm always "propagate" from the node
> with the shortest distance to the source. The effect is that my rules
> are wasting most of the time propagating paths that would be dropped
> in the end anyway...
>
> Any ideas?
>
> Thanks.
> -Simon
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] jaxb generated fact loaded into Guvnor throws errors when using the ' is contained in the comma separated list' operator

2011-07-18 Thread Michael Anstis
There is a closing bracket missing in the generated DRL.

This is a bug. Please raise a JIRA and assign to me and I'll fix for
5.3.0.Beta1.

With kind regards,

Mike

2011/7/14 

>  Hello ,
>
> I am using 5.2.0.CR1 version of Guvnor .
>
> I have a jaxb generated class loaded through the model jar into Guvnor to
> be used as a fact in the Guided Decision Table editor.
>
> When I use a field ACTIVITYCODE  of type String from the JAXB generated
> class  with  ‘ is contained in the comma separated list'  operator, I get
> compilation errors.
>
> Unable to Analyse Expression ACTIVITYCODE == "A" || ACTIVITYCODE == "B":
> [Error: no such identifier: ACTIVITYCODE] [Near : {... ACTIVITYCODE == "A"
> || ACTIVI }] ^ [Line: 1, Column: 1]
>
> But when I use equal to operator to compare value to just a string value,
> it compiles fine.
>
> This rule fails.
>
> *3.  *|   rule "Row 1 dds"
> 4.  |   ruleflow-group "None"
> 5.  |   dialect "mvel"
> 6.  |   when
> 7.  |   factClass : FACTCLASS( ACTIVITYCODE in ("A", "B")
> 8.  |   then
> 9.  |   factClass.setRATE( "5.25" );
> 10. |   end
>
> The below rule compiles fine.
>
>
> *3.  *|   rule "Row 1 dds"
> 4.  |   ruleflow-group "None"
> 5.  |   dialect "mvel"
> 6.  |   when
> 7.  |   factClass : FACTCLASS ( ACTIVITYCODE =="A")
> 8.  |   then
> 9.  |   factClass.setRATE( "5.25" );
> 10. |   end
>
> Is this issue being caused by jaxb generated class? If so, is there a way
> to fix this problem?
>
> When I use a regular pojo that is not jaxb generated, the
>
> is contained in the comma separated list'  operator works fine.
>
> Can someone provide any direction or thoughts on this?
>
> Thanks,
>
> Ram
>
>
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Global variable in LHS

2011-07-18 Thread pamerida
OK, thank you both for your suggestions :)

--
View this message in context: 
http://drools.46999.n3.nabble.com/Global-variable-in-LHS-tp3180063p3180393.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


[rules-users] priority based on object properties

2011-07-18 Thread Simon Chen
Hi all,

I am curious if we can inform Drools' execution based on properties
within objects.

In particular, the salience value is defined for each rule, in the
sense that rule A has priority over rule B to execute. I am wondering
if we can define some kinda of salience metric, such that object X has
higher priority than object Y to be executed in the same rule.

To give an example, I am (still) playing with implementing shortest
path using a few rules. I have a rule for selecting a shortest path on
a node (among all the paths received from its neighbors) to a source
node, and another rule for propagating the shortest path on a node to
neighboring nodes. When I have many nodes in my graph, I found that
the paths propagated (via the second rule) are not always the
shortest, while Dijkstra's algorithm always "propagate" from the node
with the shortest distance to the source. The effect is that my rules
are wasting most of the time propagating paths that would be dropped
in the end anyway...

Any ideas?

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


Re: [rules-users] Global variable in LHS

2011-07-18 Thread Mauricio Salatino
That's right.. globals are usually used to access to external services and
usually you don't want to do inferences over that global references. Global
are not facts. If you want to do inferences create a fact :)

Cheers

On Mon, Jul 18, 2011 at 3:55 PM, Swindells, Thomas wrote:

> Don't use a global, instead create a new fact type "Global" having a single
> field globalVariable (type object will probably do), then you can pretty
> much write what you have below (once you add the missing bracket).
> Alternatively you may be able to do something like eval(Arrays.asList("X",
> "Y").contains(globalVariable))
>
> Thomas
>
> > -Original Message-
> > From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
> > boun...@lists.jboss.org] On Behalf Of pamerida
> > Sent: 18 July 2011 19:09
> > To: rules-users@lists.jboss.org
> > Subject: [rules-users] Global variable in LHS
> >
> > Hi everybody,
> >
> > I would like to analyze a global value in the LHS of my rule without
> using an
> > eval, something like this:
> >
> >
> > global String globalVariable;
> >
> >   rule 'SI-002-NAD-6'
> >   salience 5000
> >   when
> >   global (globalVariable in ("X","Y")
> >   then
> >   logger.log("[SI-002-NAD-6] Debe colocar la información del
> > propietario del medio de transporte.");
> >   end
> >
> > I cant use eval because it doesnt recognize the keyword "in", for example
> > this code would throw me an error in the validation
> >
> >  global String globalVariable;
> >
> >   rule 'SI-002-NAD-6'
> >   salience 5000
> >   when
> >   eval (globalVariable in ("X","Y")
> >   then
> >   logger.log("[SI-002-NAD-6] Debe colocar la información del
> > propietario del medio de transporte.");
> >   end
> >
> > any suggestions? thanks so much for your help :)
> >
> >
> >
> > --
> > View this message in context: http://drools.46999.n3.nabble.com/Global-
> > variable-in-LHS-tp3180063p3180063.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
>
>
>
> **
> This message is confidential and intended only for the addressee. If you
> have received this message in error, please immediately notify the
> postmas...@nds.com and delete it from your system as well as any copies.
> The content of e-mails as well as traffic data may be monitored by NDS for
> employment and security purposes. To protect the environment please do not
> print this e-mail unless necessary.
>
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
> 4EX, United Kingdom. A company registered in England and Wales. Registered
> no. 3080780. VAT no. GB 603 8808 40-00
>
> **
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Global variable in LHS

2011-07-18 Thread Swindells, Thomas
Don't use a global, instead create a new fact type "Global" having a single 
field globalVariable (type object will probably do), then you can pretty much 
write what you have below (once you add the missing bracket).
Alternatively you may be able to do something like eval(Arrays.asList("X", 
"Y").contains(globalVariable))

Thomas

> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
> boun...@lists.jboss.org] On Behalf Of pamerida
> Sent: 18 July 2011 19:09
> To: rules-users@lists.jboss.org
> Subject: [rules-users] Global variable in LHS
>
> Hi everybody,
>
> I would like to analyze a global value in the LHS of my rule without using an
> eval, something like this:
>
>
> global String globalVariable;
>
>   rule 'SI-002-NAD-6'
>   salience 5000
>   when
>   global (globalVariable in ("X","Y")
>   then
>   logger.log("[SI-002-NAD-6] Debe colocar la información del
> propietario del medio de transporte.");
>   end
>
> I cant use eval because it doesnt recognize the keyword "in", for example
> this code would throw me an error in the validation
>
>  global String globalVariable;
>
>   rule 'SI-002-NAD-6'
>   salience 5000
>   when
>   eval (globalVariable in ("X","Y")
>   then
>   logger.log("[SI-002-NAD-6] Debe colocar la información del
> propietario del medio de transporte.");
>   end
>
> any suggestions? thanks so much for your help :)
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Global-
> variable-in-LHS-tp3180063p3180063.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


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


[rules-users] Global variable in LHS

2011-07-18 Thread pamerida
Hi everybody,

I would like to analyze a global value in the LHS of my rule without using
an eval, something like this:

 
global String globalVariable;

rule 'SI-002-NAD-6'
salience 5000
when
global (globalVariable in ("X","Y")
then
logger.log("[SI-002-NAD-6] Debe colocar la información del propietario 
del
medio de transporte.");
end

I cant use eval because it doesnt recognize the keyword "in", for example
this code would throw me an error in the validation

 global String globalVariable;

rule 'SI-002-NAD-6'
salience 5000
when
eval (globalVariable in ("X","Y")
then
logger.log("[SI-002-NAD-6] Debe colocar la información del propietario 
del
medio de transporte.");
end

any suggestions? thanks so much for your help :)



--
View this message in context: 
http://drools.46999.n3.nabble.com/Global-variable-in-LHS-tp3180063p3180063.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


[rules-users] how to invoke rest service on drools server with serialized objects

2011-07-18 Thread Lisa Horton
I installed drools-server (5.2 final) in tomcat and was able to invoke the 
sample Soap service using SoapUI using Salaboy's excellent blog post 
instructions.  I have modified knowledge-services.xml to add my rule base using 
a knowledge agent, and changed camel-server.xml to marshal/unmarshal using 
serialization.  The drools-server starts up without error, but when I try to 
call the rest service from my java client, I get  HTTP response: status code = 
415, status message = [Unsupported Media Type].

Any suggestions or example of how to do this?  I am attaching my xml files.  
the application-Context-rulesTestIntegrationExamples.xml is the spring bean 
definition for my client java program.






http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";>

	
		http://192.168.57.128:8280/drools-server/kservice/rest/execute"/>
		
		
			


	
		



	

			
		
	



http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:cxf="http://camel.apache.org/schema/cxf";
   xmlns:jaxrs="http://cxf.apache.org/jaxrs";
   xsi:schemaLocation="
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
   http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
   http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
   http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">

  
  
  
  

  

   
  
   
   
   

  
  http://soap.jax.drools.org/"; >

  
  

  

  


  http://camel.apache.org/schema/spring";>

 

   
   
 
 

   



  
  
   


  


  




http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:drools="http://drools.org/schema/drools-spring";
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring-1.3.0.xsd";>

	

	

	

	
		
			
		
	

	

	

	
		
			
		
	

	


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


Re: [rules-users] PDFs of Drools 5.2.final: pictures too big

2011-07-18 Thread Michael Anstis
The PDF is generated from DocBook source, as is the "HTML" and "HTML single"
versions of the documentation.

There are some known compile-time issues scaling the images correctly for
the PDF.

Feel free to either:-

(a) Fix the image scaling yourself and contribute back to the project

(b) Attach a list of all affected images (what user-guide, what section,
what image etc) to a JIRA for us to eventually look at.

With kind regards,

Mike

On 18 July 2011 17:16, itchupe  wrote:

> Hello there
>
> I wanted to print the documentation but the pictures are a too big to fit
> in
> the page (some content cut off). Is the pdf official and could you maybe
> adjust the pics?
> Or do i need to use the html-version?
>
> (one index of pdf was really small, need to check which one if interested.)
>
>
> cheers
> marianna
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/PDFs-of-Drools-5-2-final-pictures-too-big-tp3179659p3179659.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
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] PDFs of Drools 5.2.final: pictures too big

2011-07-18 Thread Geoffrey De Smet
Use the html version at this time.

It's a known issue in of the pressgang-styles
   
https://anonsvn.jboss.org/repos/pressgang/pressgang-tools/trunk/pressgang-xslt-ns/
and there's a jira of it, but no fix yet.

Op 18-07-11 18:16, itchupe schreef:
> Hello there
>
> I wanted to print the documentation but the pictures are a too big to fit in
> the page (some content cut off). Is the pdf official and could you maybe
> adjust the pics?
> Or do i need to use the html-version?
>
> (one index of pdf was really small, need to check which one if interested.)
>
>
> cheers
> marianna
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/PDFs-of-Drools-5-2-final-pictures-too-big-tp3179659p3179659.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
>

-- 
With kind regards,
Geoffrey De Smet


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


[rules-users] PDFs of Drools 5.2.final: pictures too big

2011-07-18 Thread itchupe
Hello there

I wanted to print the documentation but the pictures are a too big to fit in
the page (some content cut off). Is the pdf official and could you maybe
adjust the pics?
Or do i need to use the html-version?

(one index of pdf was really small, need to check which one if interested.)


cheers
marianna

--
View this message in context: 
http://drools.46999.n3.nabble.com/PDFs-of-Drools-5-2-final-pictures-too-big-tp3179659p3179659.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] errors of deploying Guvnor 5.2.0 to JBoss 7.0

2011-07-18 Thread Geoffrey De Smet


Op 18-07-11 12:33, cross.cy schreef:
> Also in JBoss AS 7 modules the org/cxf folder is empty. So i suspect the
> dependencies need to be explicitly specified in the MF file.
That META-INF/modules.xml file is optional, IIRC.
> Cheers
>
> Yu
>
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/errors-of-deploying-Guvnor-5-2-0-to-JBoss-7-0-tp3177755p3178751.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
>

-- 
With kind regards,
Geoffrey De Smet


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


Re: [rules-users] ERROR: stream classdesc serialVersionUID = 5166066541265170937, local class serialVersionUID = 8808844570772337501

2011-07-18 Thread Wolfgang Laun
Don't use those SNAPSHOT jars - get the 5.2.0.FINAL ones.
-W


On 18 July 2011 11:11, gbelin  wrote:

> Hi there,
>
> I am trying load the example package mortgages with
> /
> KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
> "MortgageAgent" );
> kagent.applyChangeSet( ResourceFactory.newUrlResource(
> "
> http://localhost:8080/guvnor-webapp/org.drools.guvnor.Guvnor/package/mortgages/LATEST/ChangeSet.xml
> "
> ) );
> KnowledgeBase kbase = kagent.getKnowledgeBase();/
>
> the execution of the "applyChangeSet" produces the error:
>
>
> /java.lang.RuntimeException: KnowledgeAgent exception while trying to
> deserialize KnowledgeDefinitionsPackage
>at
>
> org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:732)
>at
>
> org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:965)
>at
>
> org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:774)
>at
>
> org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:646)
>at
>
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
>at
>
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:172)
>at com.sample.DroolsTest.main(DroolsTest.java:42)
> Caused by: java.io.InvalidClassException:
> org.drools.rule.MVELDialectRuntimeData; local class incompatible: stream
> classdesc serialVersionUID = 5166066541265170937, local class
> serialVersionUID = 8808844570772337501
>at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
>
>
> /
>
>
> I suppose it is a problem with different versions of any library, but I do
> not know which one, I think I have the latest version of all libraries ...
>
> My development environment:
>
> Server:
>  Apache Tomcat  6.0.26
>  Guvnor server Version 5.2.0.Final
>
> Client:
>  Eclipse 3.5 Galileo
>  Java jre6
>  mvel2.jar version 2.0.19
>  drools-api.jar Bundle-Version: 5.2.0.SNAPSHOT
>  drools-core.jar Bundle-Version: 5.2.0.SNAPSHOT
>
>
> Thanks in advance.
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/ERROR-stream-classdesc-serialVersionUID-5166066541265170937-local-class-serialVersionUID-880884457071-tp3178597p3178597.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
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] errors of deploying Guvnor 5.2.0 to JBoss 7.0

2011-07-18 Thread cross.cy
Thank you Jervis, I'll try your suggestions and see if it fixes it. I did
some further research today. JBoss AS 7 uses a new way of class loading. By
default, the modules are isolated. The guvnor war file I tried to deploy is
guvnor-5.2.0.Final-jboss-as-6.0.war. In the pom.xml I found the following
section:
"


  org.apache.cxf
  cxf-rt-frontend-jaxrs
  2.3.1
...
"
Also in JBoss AS 7 modules the org/cxf folder is empty. So i suspect the
dependencies need to be explicitly specified in the MF file. 

Cheers

Yu


--
View this message in context: 
http://drools.46999.n3.nabble.com/errors-of-deploying-Guvnor-5-2-0-to-JBoss-7-0-tp3177755p3178751.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


[rules-users] ERROR: stream classdesc serialVersionUID = 5166066541265170937, local class serialVersionUID = 8808844570772337501

2011-07-18 Thread gbelin
Hi there, 

I am trying load the example package mortgages with
/
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
"MortgageAgent" );
kagent.applyChangeSet( ResourceFactory.newUrlResource(
"http://localhost:8080/guvnor-webapp/org.drools.guvnor.Guvnor/package/mortgages/LATEST/ChangeSet.xml";
) );
KnowledgeBase kbase = kagent.getKnowledgeBase();/

the execution of the "applyChangeSet" produces the error:


/java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage  
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:732)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:965)
at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:774)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:646)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:172)
at com.sample.DroolsTest.main(DroolsTest.java:42)
Caused by: java.io.InvalidClassException:
org.drools.rule.MVELDialectRuntimeData; local class incompatible: stream
classdesc serialVersionUID = 5166066541265170937, local class
serialVersionUID = 8808844570772337501
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)


/


I suppose it is a problem with different versions of any library, but I do
not know which one, I think I have the latest version of all libraries ...

My development environment:

Server:
  Apache Tomcat  6.0.26
  Guvnor server Version 5.2.0.Final

Client:
  Eclipse 3.5 Galileo
  Java jre6
  mvel2.jar version 2.0.19
  drools-api.jar Bundle-Version: 5.2.0.SNAPSHOT
  drools-core.jar Bundle-Version: 5.2.0.SNAPSHOT


Thanks in advance.




--
View this message in context: 
http://drools.46999.n3.nabble.com/ERROR-stream-classdesc-serialVersionUID-5166066541265170937-local-class-serialVersionUID-880884457071-tp3178597p3178597.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] errors of deploying Guvnor 5.2.0 to JBoss 7.0

2011-07-18 Thread Jervis Liu
Notice this line:

org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:310)

So the problem is JaxrsScanningProcessor can not load 
CXFNonSpringServlet. This is because AS 7 JAX-RS is configured to use 
RESTEasy by default.  Two options I can think of:

1. Modify modules/org/jboss/as/jaxrs/main/module.xml to add dependencies 
on CXF modules so that JaxrsScanningProcessor can use CXF as JAX-RS 
stack as an alternative.

To go with this approach, you will have to install CXF in AS 7  by 
yourself, then define cxf modules similar to what 
org/jboss/resteasy/resteasy-jaxrs/main/module.xml does.

2. Disable JaxrsScanningProcessor so that Guvnor can use CXF to load 
JAX-RS resources using CXF's own way.

This approach is what we did in AS 6. We configured CXF to use its own 
non-standard way to load JAX-RS resources other than using the standard 
javax.ws.rs.core.Application. But for some unknown reasons, this 
approach seems not working for AS 7 anymore.

I can take a further look once I have time.

Cheers,
Jervis

On 2011/7/18 7:26, cross.cy wrote:
> Hi, I'm trying to deploy Guvnor 5.2 in JBoss AS 7.0. JBoss is running in
> standalone mode. However i came across with the following error which failed
> the deployment:
>
> 09:19:33,330 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2)
> MSC1: Failed to start service
> jboss.deployment.unit."guvnor.war".POST_MODULE:
> org.jboss.msc.service.StartException in service
> jboss.deployment.unit."guvnor.war".POST_MODULE: Failed to process phase
> POST_MODULE of deployment "guvnor.war"
>   at
> org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
>   at
> org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
>   at
> org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> [:1.6.0_24]
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> [:1.6.0_24]
>   at java.lang.Thread.run(Thread.java:680) [:1.6.0_24]
> Caused by: java.lang.LinkageError: Failed to link
> org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet (Module
> "deployment.guvnor.war:main" from Service Module Loader)
>   at
> org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401)
>   at
> org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)
>   at
> org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)
>   at org.jboss.modules.Module.loadModuleClass(Module.java:588)
>   at
> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183)
>   at
> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
>   at
> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
>   at
> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
>   at
> org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:310)
>   at
> org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:164)
>   at
> org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:113)
>   at
> org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
>   ... 5 more
> Caused by: java.lang.NoClassDefFoundError:
> org/apache/cxf/transport/servlet/CXFNonSpringServlet
>   at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_24]
>   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) 
> [:1.6.0_24]
>   at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [:1.6.0_24]
>   at 
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
> [:1.6.0_24]
>   at
> org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)
>   ... 16 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.cxf.transport.servlet.CXFNonSpringServlet from [Module
> "deployment.guvnor.war:main" from Service Module Loader]
>   at
> org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
>   at
> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
>   at
> org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
>   at
> org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
>   at
> org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
>   ... 21 more
>
> I then downloaded cxf-rt-transports-http.jar and tried to put it in both
> standalone/lib/ext folder and the modu