Re: [rules-users] Human Task Example

2010-01-25 Thread Mauricio Salatino
Hi, sorry for the delay. I'm not a fan of the eclipse plug-in but I think
that it works for testing purpose. The idea of that is to see that your
processes are working right. I will never give my users Eclipse to complete
their daily tasks. I always recommend creating your UI using the Human Tasks
API's (the one used in the Eclipse Plugin).
You can also use the GWT console, that is not in a stable release, but it
works well enough. (Once again, I always recommend to build your custom UIs
for your specific case)


On Sun, Jan 24, 2010 at 9:49 PM, Chuck.KS chuck.irvine...@gmail.com wrote:


 Guess I'll try again. Does anyone have a pointer to a worked out Human Task
 example? Having trouble putting it all together. Thanks


 Chuck.KS wrote:
 
  Hello. Is there a complete Human Task example that someone could point me
  to? I'm looking for an example that uses the Eclipse task plugin to allow
  users to complete tasks. Thanks! -Chuck
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 

 --
 View this message in context:
 http://n3.nabble.com/Human-Task-Example-tp131011p137297.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




-- 
- http://salaboy.wordpress.com
- 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] Human Task Example

2010-01-25 Thread ramram

Hi What do u have as a problem running the human task?
did u run the taskservice?
u cant start a humantask flow as long as u dont have a TaskService?
-- 
View this message in context: 
http://n3.nabble.com/Human-Task-Example-tp131011p138073.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] Better Performance and Maintainability?

2010-01-25 Thread HonorGod

Anybody? Any input? Thanks
-- 
View this message in context: 
http://n3.nabble.com/Better-Performance-and-Maintainability-tp136941p138133.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] Are knowledgebases configurable?

2010-01-25 Thread HonorGod

Anybody? Any input ? Thanks
-- 
View this message in context: 
http://n3.nabble.com/Are-knowledgebases-configurable-tp135809p138135.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] Better Performance and Maintainability?

2010-01-25 Thread Greg Barton
POJO is the way to go on all three counts:

1 - Data members in a class will be more efficient than a Map.  A Map requires 
one MapEntry instance for each entry.  Also, primitive data types would require 
boxing into the java object equivalents.  Both introduce unnecessary 
inefficiency.

2 - A Map based approach is certainly more flexible.

3 - Both are equally reusable, but since POJO is compiled I generally find it 
easier to debug. 

There's no reason why you have to go completely in one direction or another.   
If there are data members that are known to not change, put them in a POJO.  A 
POJO can have a map in it for additional, future fields.

--- On Sun, 1/24/10, HonorGod jagadeesh.motama...@barclayscapital.com wrote:

 From: HonorGod jagadeesh.motama...@barclayscapital.com
 Subject: [rules-users] Better Performance and Maintainability?
 To: rules-users@lists.jboss.org
 Date: Sunday, January 24, 2010, 10:38 AM
 
 Hi,
 
 Can someone plz help me understand performance and
 maintainability in the
 following scenario - ?
 
 I load tons of rows of data from database and store them in
 an object fact
 model [POJO based] and apply the rules using decision
 tables and finally
 persist data.
 
 vs
 
 I load tons of rows of data from database and store them in
 an object fact
 model [HashMap - Key - Value] and apply the rules using
 decision tables and
 finally persist data.
 
 The difference in the above two scenarios is that one of
 them is pojo based
 and the other is key-value pairs that are used on LHS of
 the decision
 tables. When I use Key-Value approach I had to do lot of
 conversion in terms
 converting the conditions into eval statements and
 validations but where as
 the pojo approach is very straight forward and less
 validations.
 
 Which approach gives me better performance and
 maintainability?
 
 I would consider the following before I make a decision - 
 
 1 - size of data
 2 - frequency at which the data changes [in terms of adding
 new conditions /
 adding new columns / removal of new columns etc]
 3 - re-usability
 
 Thank You!
 
 -- 
 View this message in context: 
 http://n3.nabble.com/Better-Performance-and-Maintainability-tp136941p136941.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


Re: [rules-users] Better Performance and Maintainability?

2010-01-25 Thread HonorGod

Thanks for your input.
-- 
View this message in context: 
http://n3.nabble.com/Better-Performance-and-Maintainability-tp136941p138189.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] Better Performance and Maintainability?

2010-01-25 Thread HonorGod

The things you mentioned about hashmap are true. But the only concern in
terms of flexibility - if I were to add a new column / condition in my
database / drools, it will be a new release because I need to update my pojo
to reflect new changes. Updating decision table / rules is not problem
because you got to do so if some rule is added.

Thank you,
Jagadeesh.
-- 
View this message in context: 
http://n3.nabble.com/Better-Performance-and-Maintainability-tp136941p138193.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] Drools Inference and Truth Maintenance for good rule design and maintenance

2010-01-25 Thread Mark Proctor
http://blog.athico.com/2010/01/drools-inference-and-truth-maintenance.html
http://blog.athico.com/2009/11/what-is-inference-and-how-does-it.html

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


Re: [rules-users] collection contains problem

2010-01-25 Thread Mike Dougherty
Hello Edson,

Thanks for your reply. Yes, I believe I am implementing equals and hashCode 
property in the StatusProperty class:

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

StatusProperty that = (StatusProperty) o;

if (!name.equals(that.name)) return false;
if (!value.equals(that.value)) return false;

return true;
}

@Override
public int hashCode() {
int result = name.hashCode();
result ^= value.hashCode();
return result;
}

Yes, I am adding to the properties list before inserting the TrainingStatus 
object into the session. 

Also, I tried changing from update to modify and it broke the rule. I'm using 
Drool 5.0.1, has that method been deprecated?


Thanks again for your help,
Mike



On Jan 24, 2010, at 6:36 AM, Edson Tirelli wrote:

 
The rule looks fine, so the problem is somewhere else: 
 
 * Are you properly implementing the equals()/hashcode() methods in the 
 StatusProperty class? or are you checking for the exact same instance (in 
 which case the defaul equals()/hashcode() would work)
 
 * are you adding the properties to the TrainingStatus.properties collection 
 before inserting TrainingStatus into the session? or are you calling 
 update/modify after inserting it?
 
 Also, not related to the problem at all, but we recommend you to use 
 modify() instead of update() in your rules consequence:
 
 modify( t ) {
 setNextSection( section_b ),
 setPreviousSection( section_overview )
 }
   
[]s
Edson
 
 
 2010/1/24 Mike Dougherty mjdoughe...@gmail.com
 Hello all,
 
 I've been getting more and more into using Drools Expert, but I certainly 
 still have a lot to learn. I have almost a complete rules file ready to go. 
 But I am having an issue with the LHS checking that a collection contains a 
 certain object value. The rule currently looks like this:
 
 rule Rule Name
 no-loop true
when
property : StatusProperty( name == propertyName, value == 
 valueA )
t : TrainingStatus( currentSection == section_a, properties 
 contains property )
then
t.setNextSection( section_b );
t.setPreviousSection( section_overview );
update( t );
 end
 
 
 The TrainingStatus object has the following fields:
 
 public class TrainingStatus implements Serializable {
private String currentSection;
private String nextSection;
private String previousSection;
private SetStatusProperty properties = new TreeSetStatusProperty();
 }
 
 And the StatusProperty object has the following:
 
 public class StatusProperty implements Serializable {
private String name;
private String value;
 }
 
 
 I'm inserting a TrainingStatus object that should match this rule. But the 
 resulting object does not have the nextSection and previousSection fields set 
 to the values they should.
 
 Can anyone advise on how to get this rule working as expected?
 
 Thanks for your help!
 
 Mike
 
 
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 -- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by 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


Re: [rules-users] Human Task Example

2010-01-25 Thread Todd Pagni
You  can manually add users via the OrganziationalEntity table:

 

User, Administrator

User, myuser

Etc.

 

I am doing the following to start the task server:

 

Environment env = KnowledgeBaseFactory.newEnvironment();

taskServerEntityManagerFactory = 
Persistence.createEntityManagerFactory(org.drools.task);

env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, 
taskServerEntityManagerFactory);



taskService = new TaskService(taskServerEntityManagerFactory, 
SystemEventListenerFactory

.getSystemEventListener());



server = new MinaTaskServer(taskService);

Thread thread = new Thread(server);

thread.start();

 

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Chuck.KS
Sent: Monday, January 25, 2010 1:26 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Human Task Example

 

I did see that I need to populate users, but I didn't at first seen any 
instructions on how to do so. Reading more carefully, I think I see how to do 
it now, i.e. by calling addUser(). I'll give that a try a little later today. 
Another thing that may give me a problem is that I didn't know what the second 
argument should be to the TaskService() constructor below. The documentation 
shows only one argument, but it seems that there is no one argument constructor 
anymore. Any help with that? Really appreciate your help and time! -Chuck

private static void startTaskService()

{

   EntityManagerFactory emf = 
Persistence.createEntityManagerFactory(org.drools.task);

   TaskService taskService = new TaskService(emf,null);

   MinaTaskServer server = new MinaTaskServer( taskService );




   Thread thread = new Thread( server );

   thread.start();

}

 

On Mon, Jan 25, 2010 at 1:05 PM, salaboy [via Drools - Java Rules Engine] 
[hidden email] 
http://n3.nabble.com/user/SendEmail.jtp?type=nodenode=138369i=0  wrote:

I see that problem before. It means that you need to populate some users first. 
Insert in the database an administrator user before running the process.

On Mon, Jan 25, 2010 at 3:28 PM, Chuck.KS [hidden email] 
http://n3.nabble.com/user/SendEmail.jtp?type=nodenode=138346i=0  wrote:



ramram wrote:

 Hi What do u have as a problem running the human task?
 did u run the taskservice?
 u cant start a humantask flow as long as u dont have a TaskService?


I did manage to put some code together but I didn't feel from reading 
the
documentation that I knew exactly what I was doing. I think it would be 
very
helpful and many questions would be avoided if a worked out example 
could
be provided with the drools distribution. Anyway, I really appreciate 
your
help. The error I got is indicated below.

Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
logExceptions
WARNING: SQL Error: 23002, SQLState: 23002
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
logExceptions
SEVERE: Referential integrity constraint violation: FK27A9A59B680AE0:
PUBLIC.TASK FOREIGN KEY(CREATEDBY_ID) REFERENCES
PUBLIC.ORGANIZATIONALENTITY(ID) [23002-77]
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
logExceptions
WARNING: SQL Error: 23002, SQLState: 23002
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
logExceptions
SEVERE: Referential integrity constraint violation: FK27A9A59B680AE0:
PUBLIC.TASK FOREIGN KEY(CREATEDBY_ID) REFERENCES
PUBLIC.ORGANIZATIONALENTITY(ID) [23002-77]
Jan 25, 2010 12:16:39 PM
org.hibernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE: Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute 
JDBC
batch update
       at

org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
       at

org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
       at

org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
       at 
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)

Also, I'm attaching my test file and persistence.xml file:
http://n3.nabble.com/file/n138317/RuleFlowTest.java RuleFlowTest.java ,
http://n3.nabble.com/file/n138317/persistence.xml persistence.xml
--
View this message in context: 
http://n3.nabble.com/Human-Task-Example-tp131011p138317.html

Sent from the Drools - User mailing list archive at Nabble.com.

[rules-users] how to scan subdirectories for resources change-set.xml

2010-01-25 Thread Pritham

change-set xmlns='http://drools.org/drools-5.0/change-set'
 xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
 xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd'
 
   add 
   resource source='file:rules/' type='DRL' / 
   /add 
/change-set 

Currently, drools only scans files under rules/ but none of the sub
directories under rules/

Is there a way to enable/override this in the current implementation?
-- 
View this message in context: 
http://n3.nabble.com/how-to-scan-subdirectories-for-resources-change-set-xml-tp138444p138444.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] collection contains problem

2010-01-25 Thread Mike Dougherty
Hey Edson and Wolfgang,

I went to setup an example app and rules file to send you, and it seemed to 
work correctly. So now I have to figure out the difference between the sample 
code and application code. Hopefully, I'll be able to find it.


Thanks to both of you for your help.
Mike



On Jan 25, 2010, at 10:22 AM, Edson Tirelli wrote:

 
 Mike,
 
 Wolfgang has it right. When you write:
 
property : StatusProperty( name == propertyName, value == 
 valueA )
 
 You are telling the engine that the StatusProperty is a fact in the 
 working memory. Reading that, I assumed you were inserting them, because if 
 they are not facts in the working memory, the rule will obviously never match.
 
 If you don't want to insert them (although recommended), you need to 
 rewrite the pattern using from to tell the engine where to look for the 
 properties. Example:
 
 when
t : TrainingStatus( currentSection == section_a )
property : StatusProperty( name == propertyName, value == 
 valueA ) from t.properties
 then
 end
 
 []s
 Edson
 
 2010/1/25 Mike Dougherty mjdoughe...@gmail.com
 Hello Wolfgang,
 
 Thank you for the response. However, as I read this documentation this should 
 not be necessary. Even still, if I try it, it does not seem to help.
 
 
 Thanks,
 Mike
 
 
 
 On Jan 24, 2010, at 9:17 AM, Wolfgang Laun wrote:
 
 On Sun, Jan 24, 2010 at 8:16 AM, Mike Dougherty mjdoughe...@gmail.com 
 wrote:
 
 I'm inserting a TrainingStatus object that should match this rule. But the 
 resulting object does not have the nextSection and previousSection fields 
 set to the values they should.
 
 Only because you mention the insertion of the TrainingStatus object but not 
 the one(s) of (a) StatusProperty object(s): They should be inserted, too!
 
 -W
 
 
 ___
 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
  JBoss by 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


[rules-users] Rule Templates with empty cells

2010-01-25 Thread jschmied

Hi!

If I write rules in a decision table I can leave cells empty if I don't need
to use all of the conditions in a row.

How can I do this with the ExternalSpreadsheetCompiler? 

I would need something like:

rule ru...@{row.rownumber}
when
   $s : MyType1()
@ifDefined{field1}   $e : MyType2(val1 == @{field1}) from $s.SUB;
@ifDefined{field2}   $e : MyType2(val2 == @{field2}) from $s.SUB;
then
 retract($s);
end


Thanks

Juergen
-- 
View this message in context: 
http://n3.nabble.com/Rule-Templates-with-empty-cells-tp138571p138571.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