Re: [rules-users] Uploading the fact model to the DRools BRMS

2008-01-18 Thread Rahul Upadhyay
That I am Saying My Dear.. You Problem is Class Version No.

Find out somting about That.

 I am sure..  you are missing some class  that needs to import.
do one thing.. add all the classes that you have in you application.. If you
extend some class then add it also in jaar.

that it



On Jan 18, 2008 12:37 PM, Akila Geethal [EMAIL PROTECTED] wrote:

 thats is not my problem..In the brms in the web interface im having
 problems to get the facts. Iam not yet dealing with application.I just
 want to create some rules in the web interface with the uploaded jar. in
 here when i try to edit package configuration and put the import statements
 im gettng that error.When try to create rules it does not show me any
 facts  types to add conditions..

 On Jan 18, 2008 10:57 AM, Rahul Upadhyay [EMAIL PROTECTED] 
 wrote:

  in this link
  http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html/index.html
  Read  Section 9.4.4 about property file.
  Place This file in your jar with yours Imported class.
  Make changes accordingly in your program with rule agent.
 
  all the Best
 
  Rahul Upadhyay
 
  On Jan 18, 2008 10:41 AM, akilageethal  [EMAIL PROTECTED]  wrote:
 
  
   can u tell me where does the file should be, in which i have to
   mention the
   full class names in order to identify the classes by BRMS. What is the
   format of the file?? i don hav any idea about that file.Thedocumentation
   doesnot say any thing about such file.Im trying to get the classes
   imported
   but still couldnt get it. Thanx in advance
  
  
  
  
   Anstis, Michael (M.) wrote:
   
I have a vague recollection that there is another file in which you
   need
to
list your fully qualified class names before they can be referenced
   by the
BRMS.
   
I think Kris (or Edson) has provided a posting to the group before
   about
this.
   
Flame me if I am wrong.
   
   
  _
   
From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED] ] On Behalf Of Mark
   Proctor
Sent: 10 January 2008 15:54
To: Rules Users List
Subject: Re: [rules-users] Uploading the fact model to the DRools
   BRMS
   
   
Akila Geethal wrote:
   
When I upload a jar file to the DRools BRMS it does not get
   uploaded. When
i
try to get the clsses by the import statements it says the class
   cannot be
found. Are there any special way of making the jar?Should that fact
modelapplication include special libraries or etc
   
   
No it' just a standard jar, with standard pojos.
   
   
   
   
  _
   
   
___
   
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
   
   
  
   --
   View this message in context: 
   http://www.nabble.com/Uploading-the-fact-model-to-the-DRools-BRMS-tp14731528p14946844.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 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] JBRMS 4.0.4 issues

2008-01-18 Thread mmquelo massi
Hi pope :-P   (joking...joking)

I do not understand  what you wrote here:

*5. Unzip the jboss_jsf_libs file and copy the all the files from the lib
directory of your lib directory of your Application Server installation. If
you have paths to these files already set in your environment, make sure to
update the paths to point to the new JAR files in the lib directory of the
Application Server installation.*
What should I do?

Where should I put the .zip file content?

I checked the JBOSS_HOME\lib and none of the files you mentioned are in
there. Then I checked the JBOSS_HOME\server\default\deploy\jboss-
web.deployer\jsf-libs and I found all the files contained in the .zip file
you told us.

So... Should I overwrite the jsf-libs directory or should I delete it and
copy the .zip content into the JBOSS_HOME\lib dir?
Thank You anyway Fernando.

Massi


On Jan 18, 2008 1:49 AM, Fernando Meyer [EMAIL PROTECTED] wrote:

 Hi peeps,

 After we received a couple of feedbacks about 4.0.4 drools-jbrms, I did
 some tests against JBoss 4.2.2 and Tomcat 6.0.x and I have a resolution
 workaround
 please check http://wiki.jboss.org/wiki/Wiki.jsp?page=JBRMSjsfdependenciesfor 
 further explanations

 I'm waiting your feedbacks about this problem

 Thanks

 --
 Fernando Meyer http://fmeyer.org
 JBoss Rules Core Developer
 [EMAIL PROTECTED]
 ___
 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] Exception: Conversion to long not supported for type: class org.drools.examples.BilboAndTheDwarfs$DwarfShadowProxy

2008-01-18 Thread gnumpf2006-drools
Hi Mailinglist,

as discussed with tirelli in irc chat yesterday, I am sending my code:

I modified the golfer example with an other riddle. I wrote all given rules and 
when I run the code I get an 

Exception in thread main org.drools.RuntimeDroolsException:
 Conversion to long not supported for type: class 
org.drools.examples.BilboAndTheDwarfs$DwarfShadowProxy
at org.drools.spi.PatternExtractor.getLongValue(PatternExtractor.java:125)
at 
org.drools.rule.VariableRestriction$LongVariableContextEntry.updateFromTuple(VariableRestriction.java:260)
at 
org.drools.common.DefaultBetaConstraints.updateFromTuple(DefaultBetaConstraints.java:139)
[...]

I put my code in a tgz file which contains the following files:

BilboAndTheDwarfs.java -- my java class (based on golfer example)
BilboAndTheDwarfs.drl- my rules
 outputWithException.txt  - my output on the console
remarks.txt - some remarks to the output
riddle.txt - the riddle (automaticly translated)
solution.txt- the solution of the riddle

I hope you can help me. Thank you in advance

Oliver (aka Hightower, gnumpf2006)



__  Ihr erstes Baby? Holen Sie sich 
Tipps von anderen Eltern.  www.yahoo.de/clever

drools-problem.tgz
Description: GNU Zip compressed data
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Exception: Conversion to long not supported for type: class org.drools.examples.BilboAndTheDwarfs$DwarfShadowProxy

2008-01-18 Thread Edson Tirelli
 Oliver,

 In you Bilbo pattern you wrote:

pos  $Ori,

 pos is an int attribute, while $Ori is bound to a Dwarf object.
 It is not possible to convert one type into the other to make the
comparison.

[]s
Edson



2008/1/18, [EMAIL PROTECTED] [EMAIL PROTECTED]:

 Hi Mailinglist,

 as discussed with tirelli in irc chat yesterday, I am sending my code:

 I modified the golfer example with an other riddle. I wrote all given
 rules and when I run the code I get an

 Exception in thread main org.drools.RuntimeDroolsException:
 Conversion to long not supported for type: class
 org.drools.examples.BilboAndTheDwarfs$DwarfShadowProxy
 at org.drools.spi.PatternExtractor.getLongValue(PatternExtractor.java
 :125)
 at
 org.drools.rule.VariableRestriction$LongVariableContextEntry.updateFromTuple
 (VariableRestriction.java:260)
 at org.drools.common.DefaultBetaConstraints.updateFromTuple(
 DefaultBetaConstraints.java:139)
 [...]

 I put my code in a tgz file which contains the following files:

 BilboAndTheDwarfs.java -- my java class (based on golfer example)
 BilboAndTheDwarfs.drl- my rules
 outputWithException.txt  - my output on the console
 remarks.txt - some remarks to the output
 riddle.txt - the riddle (automaticly translated)
 solution.txt- the solution of the riddle

 I hope you can help me. Thank you in advance

 Oliver (aka Hightower, gnumpf2006)



 __  Ihr erstes Baby? Holen Sie
 sich Tipps von anderen Eltern.  www.yahoo.de/clever
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users





-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] JBRMS 4.0.4 issues

2008-01-18 Thread Fernando Meyer
Nope,

You shouldn't change anything if you are using jboss AS, just if you are
using tomcat or other container



On Jan 18, 2008 7:40 AM, mmquelo massi [EMAIL PROTECTED] wrote:


 Hi pope :-P   (joking...joking)

 I do not understand  what you wrote here:

 *5. Unzip the jboss_jsf_libs file and copy the all the files from the lib
 directory of your lib directory of your Application Server installation. If
 you have paths to these files already set in your environment, make sure to
 update the paths to point to the new JAR files in the lib directory of the
 Application Server installation. *
 What should I do?

 Where should I put the .zip file content?

 I checked the JBOSS_HOME\lib and none of the files you mentioned are
 in there. Then I checked the JBOSS_HOME\server\default\deploy\jboss-
 web.deployer\jsf-libs and I found all the files contained in the .zip
 file you told us.

 So... Should I overwrite the jsf-libs directory or should I delete it
 and copy the .zip content into the JBOSS_HOME\lib dir?
 Thank You anyway Fernando.

 Massi


 On Jan 18, 2008 1:49 AM, Fernando Meyer [EMAIL PROTECTED] wrote:

  Hi peeps,
 
  After we received a couple of feedbacks about 4.0.4 drools-jbrms, I did
  some tests against JBoss 4.2.2 and Tomcat 6.0.x and I have a resolution
  workaround
  please check http://wiki.jboss.org/wiki/Wiki.jsp?page=JBRMSjsfdependencies
  for further explanations
 
  I'm waiting your feedbacks about this problem
 
  Thanks
 
  --
  Fernando Meyer http://fmeyer.org
  JBoss Rules Core Developer
  [EMAIL PROTECTED]
  ___
  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




-- 
Fernando Meyer http://fmeyer.org
JBoss Rules Core Developer
[EMAIL PROTECTED]
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rules Pattern Map['key'] does not work in trunk

2008-01-18 Thread Edson Tirelli
   I did not ran your code, but looking at your rules file, I don't see you
updating your container class after changing it's map attribute values:

rule modify
#enabled false
ruleflow-group modify
salience 20
when
c : MyContainer( $map : map  )
then
list.add(test );
$map.put(test1,test1 );
$map.put(test2,test2 );
$map.put(test3,test3 );
$map.put(test4,test4 );
System.out.println( drools.getRule());
end

After you insert values in the map, you must update your container fact
in order for other rules to see the changes:

update( c );

[]s
Edson

2008/1/18, Philokratis [EMAIL PROTECTED]:

 Hi Edson,


 I  have not debugged or looked drools internals yet so I am not sure what
 the problem is.
 Please find attached a rules project containing a test Case.

 Thanks

 On Jan 18, 2008 4:17 PM, Edson Tirelli [EMAIL PROTECTED] wrote:

 
 What problem are you seeing?
 
 We do have a few tests for that and they are working in trunk, so,
  maybe you can provide us the code snippet you are using to test that so that
  I can reproduce the problem in my local machine?
 
 []s
 Edson
 
  2008/1/18, Philokratis [EMAIL PROTECTED]:
  
 Hi guys,
  
   I have the following rule that does not give the expected result,
   I have succesfully tried to bind the map[key] to a variable but again
'==' does not work as expected.
  
   Is there any error in the rule or the way Map is used ?
  
   Thanks
   *
  
   rule
   *report3
  
  
   *when*
  
   MyContainer( map[
  
   'test1'] == test1 )
  
   *then*
  
   System.out.println( drools.getRule());
  
   *end*
  
  
  
   *MyContainer definition is *
  
   *public*
   *class* MyContainer
  
   *implements*
  
   *Serializable {*
  
   *private MapString, String map;*
  
   *public* MapString, String getMap() {
  
   *return* *this*.map ;
  
   }
  
   *public* *void* setMap(MapString, String map) {
  
   *this*.map = map;
  
   }
  
   }
  
   ___
   rules-users mailing list
   rules-users@lists.jboss.org
   https://lists.jboss.org/mailman/listinfo/rules-users
  
  
 
 
  --
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.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





-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


@Edson: Thanks! (AW: [rules-users] Exception: Conversion to long not supported for type: ...)

2008-01-18 Thread gnumpf2006-drools
Hi Edson,

Of course, you are right!

Thank you very much for finding my stupid mistake. I just forgot to type .pos
I just fixed some other bug and now it is working fine. 

Best regards,

Oliver (aka Hightower, gnumpf2006)




  Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: 
http://de.yahoo.com/set___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rules Pattern Map['key'] does not work in trunk

2008-01-18 Thread Edson Tirelli
   What problem are you seeing?

   We do have a few tests for that and they are working in trunk, so, maybe
you can provide us the code snippet you are using to test that so that I can
reproduce the problem in my local machine?

   []s
   Edson

2008/1/18, Philokratis [EMAIL PROTECTED]:

 Hi guys,

 I have the following rule that does not give the expected result,
 I have succesfully tried to bind the map[key] to a variable but again
  '==' does not work as expected.

 Is there any error in the rule or the way Map is used ?

 Thanks
 *

 rule
 * report3


 *when*

 MyContainer( map[

 'test1'] == test1 )

 *then*

 System.out.println( drools.getRule());

 *end*



 *MyContainer definition is *

 *public*
 *class* MyContainer

 *implements*

 *Serializable {*

 *private MapString, String map;*

 *public* MapString, String getMap() {

 *return* *this*.map ;

 }

 *public* *void* setMap(MapString, String map) {

 *this*.map = map;

 }

 }

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




-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Rules Pattern Map['key'] does not work in trunk

2008-01-18 Thread Philokratis
Hi guys,

I have the following rule that does not give the expected result,
I have succesfully tried to bind the map[key] to a variable but again  '=='
does not work as expected.

Is there any error in the rule or the way Map is used ?

Thanks
*

rule* report3

 *when
*

MyContainer( map['test1'] == test1 )

*then
*

System.out.println( drools.getRule());

*end*



*MyContainer definition is *

*public* *class* MyContainer

*implements*

*Serializable {*

*private MapString, String map;
*

*public* MapString, String getMap() {

*return* *this*.map;

}

*public* *void* setMap(MapString, String map) {

*this*.map = map;

}

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


RE: [rules-users] Uploading the fact model to the DRools BRMS

2008-01-18 Thread Jones, Alan R
Actually I am having the same problem...
 
I create a jar from a schema containing all the classes that the rule will work 
with. In the BRMS, I upload it as an asset in a model archive. Then when I edit 
package config, I put import statements per the following:
 
  import com.mycompany.model.vehicles.*;
  import org.apache.xmlbeans.*;
 
and when I do a vailidation, it throws error saying No Such class for import 
com.mycompany.model.vehicles.* or something similar.
 
However, if I change it to a specific class:
 
   import com.mycompany.model.vehicles.Scooter;
   import org.apache.xmlbeans.XmlObject;
 
...it does validate/save successfully. So it looks like there is a problem with 
the wildcard? I should mention this is in the context of JBoss App Server 
4.x...in Tomcat 6, it doesn't work even with explicit class in the import -- is 
there something about BRMS running in Tomcat 6 and uploaded jar files (model 
archives)?
 
The wildcard could be a problem as I use xmlbeans to generate my data model 
from an xsd (I pass xml docs via  SOAP messages). The result is a jar with a 
LOT of classes that could be very painful to have to import class by class.
 
 
 
 
 


From: Rahul Upadhyay [mailto:[EMAIL PROTECTED]
Sent: Fri 1/18/2008 1:54 AM
To: Rules Users List
Subject: Re: [rules-users] Uploading the fact model to the DRools BRMS


That I am Saying My Dear.. You Problem is Class Version No.

Find out somting about That.

 I am sure..  you are missing some class  that needs to import.
do one thing.. add all the classes that you have in you application.. If you 
extend some class then add it also in jaar. 

that it




On Jan 18, 2008 12:37 PM, Akila Geethal [EMAIL PROTECTED] wrote:


thats is not my problem..In the brms in the web interface im having 
problems to get the facts. Iam not yet dealing with application.I just want to 
create some rules in the web interface with the uploaded jar. in here when i 
try to edit package configuration and put the import statements im gettng that 
error.When try to create rules it does not show me any facts  types to add 
conditions.. 


On Jan 18, 2008 10:57 AM, Rahul Upadhyay  [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]  wrote:


in this link 


http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html/index.html

Read  Section 9.4.4 about property file.
Place This file in your jar with yours Imported class. 
Make changes accordingly in your program with rule agent. 


all the Best

Rahul Upadhyay


On Jan 18, 2008 10:41 AM, akilageethal  [EMAIL PROTECTED]  
wrote:



can u tell me where does the file should be, in which i 
have to mention the 
full class names in order to identify the classes by 
BRMS. What is the
format of the file?? i don hav any idea about that 
file.The documentation
doesnot say any thing about such file.Im trying to get 
the classes imported 
but still couldnt get it. Thanx in advance





Anstis, Michael (M.) wrote:

 I have a vague recollection that there is another 
file in which you need
 to
 list your fully qualified class names before they can 
be referenced by the
 BRMS.

 I think Kris (or Edson) has provided a posting to the 
group before about
 this.

 Flame me if I am wrong. 


   _

 From: [EMAIL PROTECTED]
 [mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
] On Behalf Of Mark Proctor
 Sent: 10 January 2008 15:54
 To: Rules Users List
 Subject: Re: [rules-users] Uploading the fact model 
to the DRools BRMS


 Akila Geethal wrote: 

 When I upload a jar file to the DRools BRMS it does 
not get uploaded. When
 i
 try to get the clsses by the import statements it 
says the class cannot be
 found. Are there any special way of making the 
jar?Should that fact 
 modelapplication include special libraries or etc


 No it' just a standard jar, 

RE: [rules-users] Uploading the fact model to the DRools BRMS

2008-01-18 Thread jack80

Also I have the same problem..  someone can explain which exactly are the
steps to follow? how must be created the property file in the jar? an
example.. thanks in advance

Jones, Alan R wrote:
 
 Actually I am having the same problem...
  
 I create a jar from a schema containing all the classes that the rule will
 work with. In the BRMS, I upload it as an asset in a model archive. Then
 when I edit package config, I put import statements per the following:
  
   import com.mycompany.model.vehicles.*;
   import org.apache.xmlbeans.*;
  
 and when I do a vailidation, it throws error saying No Such class for
 import com.mycompany.model.vehicles.* or something similar.
  
 However, if I change it to a specific class:
  
import com.mycompany.model.vehicles.Scooter;
import org.apache.xmlbeans.XmlObject;
  
 ...it does validate/save successfully. So it looks like there is a problem
 with the wildcard? I should mention this is in the context of JBoss App
 Server 4.x...in Tomcat 6, it doesn't work even with explicit class in the
 import -- is there something about BRMS running in Tomcat 6 and uploaded
 jar files (model archives)?
  
 The wildcard could be a problem as I use xmlbeans to generate my data
 model from an xsd (I pass xml docs via  SOAP messages). The result is a
 jar with a LOT of classes that could be very painful to have to import
 class by class.
  
  
  
  
  
 
 
 From: Rahul Upadhyay [mailto:[EMAIL PROTECTED]
 Sent: Fri 1/18/2008 1:54 AM
 To: Rules Users List
 Subject: Re: [rules-users] Uploading the fact model to the DRools BRMS
 
 
 That I am Saying My Dear.. You Problem is Class Version No.
 
 Find out somting about That.
 
  I am sure..  you are missing some class  that needs to import.
 do one thing.. add all the classes that you have in you application.. If
 you extend some class then add it also in jaar. 
 
 that it
 
 
 
 
 On Jan 18, 2008 12:37 PM, Akila Geethal [EMAIL PROTECTED] wrote:
 
 
   thats is not my problem..In the brms in the web interface im having
 problems to get the facts. Iam not yet dealing with application.I just
 want to create some rules in the web interface with the uploaded jar. in
 here when i try to edit package configuration and put the import
 statements im gettng that error.When try to create rules it does not show
 me any facts  types to add conditions.. 
   
   
   On Jan 18, 2008 10:57 AM, Rahul Upadhyay  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]  wrote:
   
 
   in this link 
 
   
 http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html/index.html
   
   Read  Section 9.4.4 about property file.
   Place This file in your jar with yours Imported class. 
   Make changes accordingly in your program with rule agent. 
 
 
   all the Best
   
   Rahul Upadhyay
   
   
   On Jan 18, 2008 10:41 AM, akilageethal  [EMAIL PROTECTED]  
 wrote:
   
 
 
   can u tell me where does the file should be, in which i 
 have to mention
 the 
   full class names in order to identify the classes by 
 BRMS. What is the
   format of the file?? i don hav any idea about that 
 file.The
 documentation
   doesnot say any thing about such file.Im trying to get 
 the classes
 imported 
   but still couldnt get it. Thanx in advance
   
 
 
 
 
   Anstis, Michael (M.) wrote:
   
I have a vague recollection that there is another 
 file in which you
 need
to
list your fully qualified class names before they can 
 be referenced
 by the
BRMS.
   
I think Kris (or Edson) has provided a posting to the 
 group before
 about
this.
   
Flame me if I am wrong. 
   
   
  _
   
From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] ] On Behalf Of Mark Proctor
Sent: 10 January 2008 15:54
To: Rules Users List
Subject: Re: [rules-users] Uploading the fact model 
 to the DRools
 BRMS
   
   
Akila Geethal wrote: 
   
When I upload a jar file to the DRools BRMS it does 
 not get uploaded.
 When
i
try to get the clsses by the import statements it 
 says the class
 cannot be
found. Are there any special way 

[rules-users] Re: [ccapi] Trying out the new TradeSystem...onCandle isnt being called

2008-01-18 Thread Henry Canterburry

Mike,

Yup...I saw earlier that start had become final so I changed it to setup 
and terminate which you commented should be extended. I also removed the 
@Start annotation and are not observing any duplicate activation.


I'll remove my broker setter too.

As I was mentioning to Eric earlier, I would really like to see some 
interfaces for TradeSystemnot just a base class. Maybe the number of 
interfaces prior to the last refactoring was a bit excessive, but having 
no interfaces I don't think is a good idea.


I just migrated to using the SeriesSourceToIterator... data util but 
that seems not to have fixed my earlier problem of onCandle not being 
called. Didn't see this functionality so I wrote that iterator. There is 
so much functionality lying around AQ that I have no clue what it really 
does.


As to my trade system...you can essentially ignore any of the engine 
stuff...I think it would be a perfectly valid test if you simply 
commented out anything rule engine related in that system class and put 
in sysouts instead. I actually tried that already to see if any of the 
engine setup was causing the problem but I observe the same behavior 
when the class essentially does nothing. The onCandle method is still 
not being called. I was looking at all the different java contexts in 
the samples but couldn't figure out what would make a difference. Would 
it matter how I load the system? I use the SpringContextBuilder.build 
and pass a factory file and then call start on the context.


HC


Mike Kroutikov wrote:
Its most likely a context problem... I will get to it shortly. If you 
can provide a simpler reproduction, that would be helpful (i.e. maybe 
SampleTradeSystem with just few changes?).


Please, update from the head: TradeSystemBase has been changed 
slightly: rename your start()/stop() to onStart()/onStop().


minor thing: you can just use brokerService from the base class, no 
need to request it second time... unless you need it as a setter 
elsewhere


And be careful with @Start annotation: AQ context will execute *all* 
methods annotated with @Start, even if one routes control to another. 
So when you switch to onStart(), make sure you do not annotate it.


Thanks for using this, and especially for the choice to live 
dangerously! You comments, feedback, and contributions are very needed.


-Mike

On Jan 18, 2008 10:24 PM, Henry Canterburry  [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Mike...yes...I do live dangerously but it's because I see all the
good
things you guys are cranking out and I don't want to miss out on the
latest. I am seeing however how it causes me headaches tho :-)

Yes, I am using the TradeSystemBase from simple and I primarily
based my
strategy off of SampleTradeSystem:

@TradeSystem
public class RuleBaseTradeSystem extends TradeSystemBase {

   private String[] ruleFiles;
   private String[] flowFiles;
   private StatefulEngine engine;
   private String description;
   private String name;
   private String flowID;

   private Account account;
   @Inject
   private IStoreService storeService;

   private IBroker broker;

   @Inject(name=broker)
   public void setBroker(IBroker broker) {
   this.broker = broker;
   }

   @Start
   public void start() throws Exception {

   log.info (start(): RuleBaseTradeSystem started...);

   subscribeToCandleStream(
   new InstrumentSpecification(new Symbol(^GSPC)),
   TimeFrame.TIMEFRAME_1_DAY );

   DecisionRequest request = new DecisionRequest();
   request.addRequestObject(account, account);
   request.addRequestObject(orders, new
NamedCollectionOrder(orders));
   request.addRequestObject(constraints, new
NamedCollectionOrderConstraint(constraints));
   request.setRuleflowID(this.flowID);

   DecisionResponse response = engine.execute(request);
   }

   public void setAccount(Account account) {
   this.account = account;
   }

   public RuleBaseTradeSystem(String name,
   String description,
   String[] ruleFiles) throws Exception {

   this.name http://this.name = name;
   this.description = description;
   this.ruleFiles = ruleFiles;
   this.engine =
RuleServiceFactory.getInstance ().newStatefulEngine(ruleFiles);
   }

   public RuleBaseTradeSystem(String name,
   String description,
   String[] ruleFiles,
   String[] ruleFlowFiles,
   String flowID) throws Exception {

   this.name http://this.name = name;
   this.description = description;
   this.ruleFiles = ruleFiles;
   this.flowFiles = ruleFlowFiles;
   this.engine =
RuleServiceFactory.getInstance().newStatefulEngine(ruleFiles,
ruleFlowFiles);
   this.flowID