[rules-users] Test Failure: RioRemoteTest

2009-11-17 Thread mardo
I am executing mvn -Ddocumentation -Declipse clean install on the current
sources in SVN, with the following reoccurring result:


Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.324 sec

Results :

Tests in error:
  testFireAllRules(org.drools.vsm.ServiceManagerRioRemoteTest)
  testExecute(org.drools.vsm.ServiceManagerRioRemoteTest)
  testNamedService(org.drools.vsm.ServiceManagerRioRemoteTest)
  testVsmPipeline(org.drools.vsm.ServiceManagerRioRemoteTest)

[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] There are test failures.

Please refer to C:\droolsinst\Drollig\drools-vsm\target\surefire-reports for
the
 individual test results.


Looking in surefire reports at the concerned location, I have

java.lang.NullPointerException
at
org.drools.vsm.ServiceManagerRioRemoteTest.setUp(ServiceManagerRioRemoteTest
.java:21)

Which in turn corresponds to the LoC 

GenericMessageHandler handler =
((SessionServiceImpl)rioServer.getSessionService()).getGenericMessageHandler
();



Do you have any suggestions on how to prevent this error?



Thanks alot, Markus

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


Re: [rules-users] Drools flow web console (5.1.M1) deployment in JBoss

2009-11-17 Thread ramram8

thnx Mauricio 4 ur help bug fixed after using the latest
hibernate-validator-4.0.2.GA.jar and hibernate3.jar
-- 
View this message in context: 
http://old.nabble.com/Drools-flow-web-console-%285.1.M1%29-deployment-in-JBoss-tp25952512p26386137.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] dynamic temporal parameters

2009-11-17 Thread Mark Proctor
Ming Fang wrote:
 Is it possible to make temporal parameters dynamic by using bound variables?
 Example:
   EventA( this after[ $later ] $eventB)
   
Currently, no.

Mark
 --ming
 ___
 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] Test Failure: RioRemoteTest

2009-11-17 Thread Mauricio Salatino
I will review that error today

2009/11/17 mardo ma...@abicola.de

  I am executing mvn -Ddocumentation -Declipse clean install on the
 current sources in SVN, with the following reoccurring result:

 Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.324 sec

 Results :

 Tests in error:
   testFireAllRules(org.drools.vsm.ServiceManagerRioRemoteTest)
   testExecute(org.drools.vsm.ServiceManagerRioRemoteTest)
   testNamedService(org.drools.vsm.ServiceManagerRioRemoteTest)
   testVsmPipeline(org.drools.vsm.ServiceManagerRioRemoteTest)

 [INFO]
 
 [ERROR] BUILD FAILURE
 [INFO]
 
 [INFO] There are test failures.

 Please refer to C:\droolsinst\Drollig\drools-vsm\target\surefire-reports
 for the
  individual test results.

 Looking in surefire reports at the concerned location, I have

 java.lang.NullPointerException
 at
 org.drools.vsm.ServiceManagerRioRemoteTest.setUp(ServiceManagerRioRemoteTest.java:21)

 Which in turn corresponds to the LoC

 GenericMessageHandler handler =
 ((SessionServiceImpl)rioServer.getSessionService()).getGenericMessageHandler();


 Do you have any suggestions on how to prevent this error?


 Thanks alot, Markus

 ___
 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] dynamic temporal parameters

2009-11-17 Thread Nestor Tarin Burriel
Try using DSL:

[when]temporal EventB=EventB()
[when]temporal EventA=EventA()
[when]-after {period:[0-9]+} EventB=this after[{period}d] $eventB

2009/11/17 Mark Proctor mproc...@codehaus.org

 Ming Fang wrote:
  Is it possible to make temporal parameters dynamic by using bound
 variables?
  Example:
EventA( this after[ $later ] $eventB)
 
 Currently, no.

 Mark
  --ming
  ___
  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] Working in the GWT console

2009-11-17 Thread ramram8

Hi I am having the following problem:
I am able to start the web cosole successfully and see all the process List
that I want to execute.
My scenario is the following: User Task1 - User Task2 - Send Mail

What I did is:
1- upload the jar file into Guvnor
2- upload the rf file into Guvnor
3- Build the package and restart the server
4- After logining into GWT console I can run the process and see in the User
Task1 and I can complete the task with no errors but the problem is that I
am not being able to reach to USER TASK2 

any suggestions?? 
is there problem in the upload in the Guvnor??
is there anything additional that I can do??

Please if anyone have any suggestions on this topic???
-- 
View this message in context: 
http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26387553.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] [Urgent] Error in ontext assist in DSLR Editor

2009-11-17 Thread hamza bakkali
Hi All,

I have been using drools 4 for couple of months now and I am starting to get
the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2
(Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor:
Context Assist + space + enter removes/replaces the whole line, not only the
place holder.

In other words:

DSL:
[*][]Log : {msg}=System.out.println({msg});
[*][]id1=some id label

DSLR:
rule MyRule
when
then
end

If I Press L , control space -- the line Log:{msg} appears in the context
menu. Hit enter I get
Log :{msg}

Now, If want to replace msg by id1. I position the cursor in the {msg}, hit
ctrl space, id1 shows in the list. I hit enter the whole line disappear, and
I am left with
id1
instead of
Log : id1

Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.

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


Re: [rules-users] Working in the GWT console

2009-11-17 Thread Kris Verlaenen
Does your test case work if you run it from Eclipse directly (for
example using a knowledge agent to load them from guvnor or simply
loading from file system) and using the Eclipse task client (to
eliminate the possibility that there is something wrong with the
process)?  Might be useful if you could show us the process itself as well.

Kris

Quoting ramram8 ramram...@gmail.com:

 
 Hi I am having the following problem:
 I am able to start the web cosole successfully and see all the
 process List
 that I want to execute.
 My scenario is the following: User Task1 - User Task2 - Send Mail
 
 What I did is:
 1- upload the jar file into Guvnor
 2- upload the rf file into Guvnor
 3- Build the package and restart the server
 4- After logining into GWT console I can run the process and see in
 the User
 Task1 and I can complete the task with no errors but the problem is
 that I
 am not being able to reach to USER TASK2 
 
 any suggestions?? 
 is there problem in the upload in the Guvnor??
 is there anything additional that I can do??
 
 Please if anyone have any suggestions on this topic???
 -- 
 View this message in context:
 http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26387553.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
 




Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Flow :Persistence Problem : Restore StatefulKnowledgeSession from database

2009-11-17 Thread Kris Verlaenen
Preferably you should cache the session itself as well (so you don't
have to recreate it all the time) and reuse that across you application.
  Or you could have multiple independent sessions as well.  If you store
the key of the session somewhere, you can easily restore this session
(or sessions) after failure.

Kris

Quoting Vijay K Pandey vpan...@mdes.ms.gov:

 Let's say where we don't need timers - in those cases one can create
 (create only if its not there) a global session (create the
 sessioninfo at the drools startup - store the session primary key
 somewhere) - reuse this session across everywhere?
 
 Vijay
 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Kris
 Verlaenen
 Sent: Monday, November 16, 2009 5:12 PM
 To: Rules Users List; pardeep.ru...@lntinfotech.com
 Subject: Re: [rules-users] Drools Flow :Persistence Problem : Restore
 StatefulKnowledgeSession from database
 
 Pardeep,
 
 The behavior you are describing is indeed correct.  The session in
 this
 case is a global session, meaning that it will be used for all
 process
 instances.  Note however that, unless you are using timers, all
 other
 state (process instance state, work items, etc.) is persisted
 separately
 and the session state will basically be empty.
 
 It is also possible to have one session per process instance (or
 whatever partitioning you like).  A session has a unique id (which
 you
 can specify when reloading the session).  You'll then have to load
 the
 right session before continuing the execution of your process
 instance.
 
 Kris
 
 Quoting pardeep.ru...@lntinfotech.com:
 
  Hi Salaboy,
  Thanks for you replying.
  Yes, of course it is storing multiple process instance Id in the
  database.
  But, what I feel is that it will fail when I am trying to run two
  workflow
  at the same time simultaneously, using the same code by
 dynamically
  providing the workflow name and the parameters for each of them.
  Ideally there should be two entries for the
 StatfulKnowledgeSession
  object
  because when I try to load the StatefulKnowledgeSession object
 from
  the
  database it will give me the session object of the workflow which
 is
  last
  executed.
 
  For example lets  suppose I have two workflow 1 and 2 having two
  humantask
  in each of them . So when I finish the first Human Task of both
  workflow
  one by one.  SessionInfo  present in the database is of workflow 2
  (if 2
  is executed last). Because there is no field in the sessioninfo
  entity of
  the database regarding to which workflow it belongs to. Am I right
 ?
  So when I  try to finish the 1st workflow by executing the 2nd
  humantask
  left in it , I need to reload the StatfulKnowledgeSession object
 from
  the
  database. As there is no way of distinguishing that the session
  object
  store in the database is of which workflow , there might be a
 problem
  as I
  may get the ksession object of 2nd workflow.
 
  In case of Process Instance it is fine , because there is a field
  'processId' which will distinguish which processInstanceId belongs
 to
 
  which worklowId or processId.
  But in case of Session , there is noting as such.
  I don't what I am saying is handled in drools persistence. Please
 let
  me
  know if it there or not.
 
  Thanks  Regards
 
  Pardeep Ruhil
 
 
 
 __
 
 
 
 
 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
 ___
 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
 




Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Working in the GWT console

2009-11-17 Thread ramram8

Hi Kris
I am new to Drools. I didn't perform a test case from eclipse by using a
knowledge agent to load them from guvnor. Well I have a question after I
build the application on Guvnor should I do something like copythe .pkg to a
specific location or just restart the server and Launch the GWT console.
What I did is the following:

1- I uploaded a jar file of my process into Guvnor below is the sample java
file that i am using:

package com.fp;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderErrors;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLogger;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.drools.process.workitem.wsht.WSHumanTaskHandler;
import org.drools.runtime.StatefulKnowledgeSession;


public class TestDrools
{

public static final void main(String[] args) 
{
try 
{
System.out.println(\n\n\n   i am here );

KnowledgeBase kbase = readKnowledgeBase();

//  // create the entity manager factory and register it in 
the environment
//  EntityManagerFactory emf =
//  Persistence.createEntityManagerFactory(
org.drools.persistence.jpa );
//  Environment env = KnowledgeBaseFactory.newEnvironment();
//  env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
//  env.set( EnvironmentName.TRANSACTION_MANAGER,
//   
TransactionManagerServices.getTransactionManager() );
//
//  // create a new knowledge session that uses JPA to 
store the runtime
state
//  StatefulKnowledgeSession ksession =
//  JPAKnowledgeService.newStatefulKnowledgeSession( 
kbase, null, env
);

final StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();

// start the transaction
//  UserTransaction ut =
//(UserTransaction) new InitialContext().lookup(
java:comp/UserTransaction );
//  ut.begin();

KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, test);

ksession.getWorkItemManager().registerWorkItemHandler(Human Task, new
WSHumanTaskHandler());

ksession.getWorkItemManager().registerWorkItemHandler(Log, new
SystemOutWorkItemHandler());

// perform multiple commands inside one transaction
ksession.startProcess(testDroolsFlow);
//ksession.fireAllRules();

// commit the transaction
//  ut.commit();



} catch (Throwable t) 
{
t.printStackTrace();
}
}

private static KnowledgeBase readKnowledgeBase() throws Exception 
{
KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();

kbuilder.add(ResourceFactory.newClassPathResource(testDroolsFlow.rf),
ResourceType.DRF);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size()  0) 
{
for (KnowledgeBuilderError error: errors) 
{
System.err.println(error);
}
throw new IllegalArgumentException(Could not parse 
knowledge.);
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}

}

2- uploading the process rule flow below is the .rf file that i am using:

?xml version=1.0 encoding=UTF-8? 
process xmlns=http://drools.org/drools-5.0/process;
 xmlns:xs=http://www.w3.org/2001/XMLSchema-instance;
 xs:schemaLocation=http://drools.org/drools-5.0/process
drools-processes-5.0.xsd
 type=RuleFlow name=testDroolsFlow id=testDroolsFlow
package-name=default 

  header
  /header

  nodes
start id=1 name=Start x=16 y=181 width=80 height=40 /
end id=3 name=End x=527 y=173 width=80 height=40 /
humanTask id=4 name=Task1 x=95 y=184 width=100 height=48 
  work name=Human Task 

Re: [rules-users] Working in the GWT console

2009-11-17 Thread ramram8

Kris I also found the following issue if the USER TASK 1 and USER TASK 2 are
assigned to the same user I can see both tasks and execute them but if for
example Task 1 is assigned to admin and Task 2 is assigned to admin1 after
logging out and logging in as admin1 I cant see that the tasks that are
assigned to him in order to complete the process. Another issue if I have
another scenario a User Task Followed by LOG for example The User task is
executed but the process that is following it which is a LOG in our example
is never reached or executed.

PS. for the LOG process I defined a special handler for it which only
contanins System,out,

public class MyLogHandlerCall implements WorkItemHandler
{

public void executeWorkItem(WorkItem workItem, WorkItemManager manager)
{
try
{
System.out.println(R TEST);
}
catch(Exception e)
{
e.printStackTrace();
}
 }

public void abortWorkItem(WorkItem workItem, WorkItemManager manager)
{
 System.out.println((new StringBuilder()).append(Aborting work item
).append(workItem).toString());
 manager.abortWorkItem(workItem.getId());
}
}


Please advise!
-- 
View this message in context: 
http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26389372.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] Stateful session and non-existence of Facts

2009-11-17 Thread Leonardo Gomes
Hi Guys,

I have the following situation while running a stateful session with Drools
4.0.7:

- I want to test that a fact with a given state doesn't exist;
- It works fine
- At a certain point I have to retract all facts and reinsert them at the
stateful session - some of them actually changed and I don't want to
recreate the session b/c it's expensive
- Again the fact that didn't exist when I first created the session still
doesn't exist

** Problem: This time the rule that verified the non-existence is not fired
because I didn't insert any fact that would retrigger it.

Rule example:

rule 022

when

SiteLanguage(language : languageCode)
t : SiteSpecialServiceType(type : specialServiceType)
not SiteLanguageSpecialServiceType(specialServiceType == type, languageCode
== language)
then
consequence
end

How could I solve or workaround that?


Thanks in advance,
Leo.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools solver info = provide DSL instead of DRL to Drools Solver

2009-11-17 Thread dmzpippo-drools
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 ListString scoreDrlList = null;
    @XStreamImplicit(itemFieldName = scoreDsl)//FIXME adding DslList
    private ListString scoreDslList = null;
    @XStreamAlias(scoreDefinition)
    private ScoreDefinitionConfig scoreDefinitionConfig = new 
ScoreDefinitionConfig();

    private StartingSolutionInitializer
 startingSolutionInitializer = null;
    private ClassStartingSolutionInitializer 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 ListString getScoreDrlList() {
    return scoreDrlList;
    }

    public void setScoreDrlList(ListString scoreDrlList) {
    this.scoreDrlList = scoreDrlList;
    }

    public ListString getScoreDslList() {
        return scoreDslList;
    }

    public void setScoreDslList(ListString
 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 ClassStartingSolutionInitializer 
getStartingSolutionInitializerClass() {
    return startingSolutionInitializerClass;
    }

    public void 
setStartingSolutionInitializerClass(ClassStartingSolutionInitializer 
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);
    }
    

Re: [rules-users] Drools solver info = provide DSL instead of DRL to Drools Solver

2009-11-17 Thread dmzpippo-drools
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 ListString scoreDrlList = null;
    @XStreamImplicit(itemFieldName = scoreDsl)//FIXME adding DslList
    private ListString scoreDslList = null;
    @XStreamAlias(scoreDefinition)
    private ScoreDefinitionConfig scoreDefinitionConfig = new 
ScoreDefinitionConfig();

    private StartingSolutionInitializer
 startingSolutionInitializer = null;
    private ClassStartingSolutionInitializer 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 ListString getScoreDrlList() {
    return scoreDrlList;
    }

    public void setScoreDrlList(ListString scoreDrlList) {
    this.scoreDrlList = scoreDrlList;
    }

    public ListString getScoreDslList() {
        return scoreDslList;
    }

    public void setScoreDslList(ListString
 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 ClassStartingSolutionInitializer 
getStartingSolutionInitializerClass() {
    return startingSolutionInitializerClass;
    }

    public void 
setStartingSolutionInitializerClass(ClassStartingSolutionInitializer 
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);
    }
    

Re: [rules-users] Drools Flow :Persistence Problem : Restore StatefulKnowledgeSession from database

2009-11-17 Thread Vijay K Pandey
Is session (StatefulKnowledgeSession) thread safe?

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Kris Verlaenen
Sent: Tuesday, November 17, 2009 4:48 AM
To: Rules Users List; Vijay K Pandey
Cc: pardeep.ru...@lntinfotech.com
Subject: Re: [rules-users] Drools Flow :Persistence Problem : Restore 
StatefulKnowledgeSession from database

Preferably you should cache the session itself as well (so you don't
have to recreate it all the time) and reuse that across you application.
  Or you could have multiple independent sessions as well.  If you store
the key of the session somewhere, you can easily restore this session
(or sessions) after failure.

Kris

Quoting Vijay K Pandey vpan...@mdes.ms.gov:

 Let's say where we don't need timers - in those cases one can create
 (create only if its not there) a global session (create the
 sessioninfo at the drools startup - store the session primary key
 somewhere) - reuse this session across everywhere?

 Vijay
 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Kris
 Verlaenen
 Sent: Monday, November 16, 2009 5:12 PM
 To: Rules Users List; pardeep.ru...@lntinfotech.com
 Subject: Re: [rules-users] Drools Flow :Persistence Problem : Restore
 StatefulKnowledgeSession from database

 Pardeep,

 The behavior you are describing is indeed correct.  The session in
 this
 case is a global session, meaning that it will be used for all
 process
 instances.  Note however that, unless you are using timers, all
 other
 state (process instance state, work items, etc.) is persisted
 separately
 and the session state will basically be empty.

 It is also possible to have one session per process instance (or
 whatever partitioning you like).  A session has a unique id (which
 you
 can specify when reloading the session).  You'll then have to load
 the
 right session before continuing the execution of your process
 instance.

 Kris

 Quoting pardeep.ru...@lntinfotech.com:

  Hi Salaboy,
  Thanks for you replying.
  Yes, of course it is storing multiple process instance Id in the
  database.
  But, what I feel is that it will fail when I am trying to run two
  workflow
  at the same time simultaneously, using the same code by
 dynamically
  providing the workflow name and the parameters for each of them.
  Ideally there should be two entries for the
 StatfulKnowledgeSession
  object
  because when I try to load the StatefulKnowledgeSession object
 from
  the
  database it will give me the session object of the workflow which
 is
  last
  executed.
 
  For example lets  suppose I have two workflow 1 and 2 having two
  humantask
  in each of them . So when I finish the first Human Task of both
  workflow
  one by one.  SessionInfo  present in the database is of workflow 2
  (if 2
  is executed last). Because there is no field in the sessioninfo
  entity of
  the database regarding to which workflow it belongs to. Am I right
 ?
  So when I  try to finish the 1st workflow by executing the 2nd
  humantask
  left in it , I need to reload the StatfulKnowledgeSession object
 from
  the
  database. As there is no way of distinguishing that the session
  object
  store in the database is of which workflow , there might be a
 problem
  as I
  may get the ksession object of 2nd workflow.
 
  In case of Process Instance it is fine , because there is a field
  'processId' which will distinguish which processInstanceId belongs
 to
 
  which worklowId or processId.
  But in case of Session , there is noting as such.
  I don't what I am saying is handled in drools persistence. Please
 let
  me
  know if it there or not.
 
  Thanks  Regards
 
  Pardeep Ruhil
 
 
 
 __




 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
 ___
 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





Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
___
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] Drools Flow :Persistence Problem : Restore StatefulKnowledgeSession from database

2009-11-17 Thread Kris Verlaenen
Quoting Vijay K Pandey vpan...@mdes.ms.gov:

 Is session (StatefulKnowledgeSession) thread safe?
Yes

Kris

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Stateful session and non-existence of Facts

2009-11-17 Thread Edson Tirelli
   Leonardo,

   First, I believer there is a misconception in your reasoning: creating
sessions is supposed to be much much cheaper than retracting all facts.
Creating a rulebase is heavier, because it requires compilation, but
creating a session is supposed to be very light by design. So, first thing
you should do is change that.

   Regarding your question, if you insert:

SiteLanguage(language : languageCode)
t : SiteSpecialServiceType(type : specialServiceType)

   The rule will activate and fire. If you don't, then the rule will not
match. That is how it is supposed to work.

   Edson

2009/11/17 Leonardo Gomes leonardo.f.go...@gmail.com

 Hi Guys,

 I have the following situation while running a stateful session with Drools
 4.0.7:

 - I want to test that a fact with a given state doesn't exist;
 - It works fine
 - At a certain point I have to retract all facts and reinsert them at the
 stateful session - some of them actually changed and I don't want to
 recreate the session b/c it's expensive
 - Again the fact that didn't exist when I first created the session still
 doesn't exist

 ** Problem: This time the rule that verified the non-existence is not fired
 because I didn't insert any fact that would retrigger it.

 Rule example:

 rule 022

 when

 SiteLanguage(language : languageCode)
 t : SiteSpecialServiceType(type : specialServiceType)
 not SiteLanguageSpecialServiceType(specialServiceType == type, languageCode
 == language)
 then
 consequence
 end

 How could I solve or workaround that?


 Thanks in advance,
 Leo.
 ___
 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


Re: [rules-users] dynamic temporal parameters

2009-11-17 Thread Ming Fang
Mark,

Are there plans to support this in the future?
Should I submit a Jira?

--Ming

On Nov 17, 2009, at 4:32 AM, Mark Proctor mproc...@codehaus.org wrote:

 Ming Fang wrote:
 Is it possible to make temporal parameters dynamic by using bound  
 variables?
 Example:
EventA( this after[ $later ] $eventB)

 Currently, no.

 Mark
 --ming
 ___
 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] dynamic temporal parameters

2009-11-17 Thread Mark Proctor

Ming Fang wrote:

Mark,

Are there plans to support this in the future?
Should I submit a Jira?
  
There are plans, it's just a matter of time. As of yet, there are no 
community contributions in this cep area, so it's slow progress :(


Mark

--Ming

On Nov 17, 2009, at 4:32 AM, Mark Proctor mproc...@codehaus.org wrote:

  

Ming Fang wrote:

Is it possible to make temporal parameters dynamic by using bound  
variables?

Example:
   EventA( this after[ $later ] $eventB)

  

Currently, no.

Mark


--ming
___
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


[rules-users] No Guided DSL Rule Editor

2009-11-17 Thread Qian, Tony
I'm currently evaluating Drools as Rules Engine for our Company.  I'm kind of 
struggling with using Guvnor to create rule.  I created two fact models, one by 
uploading jar file and another using declarative model. When I tried to create 
rules, I don't see DSL Business Rule (Guided Editor) in the drop down list.  I 
only have following in drop down list. (I'm using drools-5.0-guvnor-standalone).

Business Rule (Guided editor)
DSL Business Tule (Text editor)
DRL Rule (Technical rule -text editor)
Decision Table (Spreadsheet)
Decision Table (Web -guided editor)

From  Business Rule (Guided editor), I have only There is no,  There 
Exists and Any of for condition and 'insert fact' and 'Logically insert 
fact' choice for action. Did I miss something?

Thanks,
Tony





HR
font size=1 face=ArialBCONFIDENTIALITY NOTICE: /BThe information in 
this electronic transmission and
any documents accompanying it may contain confidential and privileged
information intended for use by the individual or entity that is the intended
recipient. If you have received this message in error or due to an unauthorized
transmission or interception, please delete all copies from your system without
disclosing, copying, or transmitting this message and notify us by telephone
877TELLUS9 or by electronic mail a href = 
servicecomme...@progressive-medical.comservicecomme...@progressive-medical.com/a./font

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


Re: [rules-users] Error trying to build Drools 5.0 from source

2009-11-17 Thread mardo
*(This should be also valid for 5.1, I just want to keep the relation to
previous postings on this issue)*
 
In case anyone encounters similar obstacles: I have used newer versions of
ANT and MAVEN for building Drools 5.1 from trunk. Using the exact versions
as shown below did not yield the cyclic reference / stack overflow type of
error.
 
Additionally I ran into a number of test problems during build related to my
locale (Germany) and date formatting. As an intermediary result, the
following settings helped preventing some (but not all) build problems:
 
 
set path=C:\Program
Files\Java\jdk1.5.0_08\bin;C:\droolsinst\apache-maven-2.0.9-bin\bin;C:\drool
sinst\apache-ant-1.7.0-bin\bin
set MAVEN_OPTS=-XX:MaxPermSize=256m -Xmx1024m -Duser.country=EN
-Duser.language=en
set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_08
set MAVEN_HOME=C:\droolsinst\apache-maven-2.0.9-bin\bin
set ANT_HOME=C:\droolsinst\apache-ant-1.7.0-bin\bin
set ANT_OPTS=-Duser.country=EN -Duser.language=en 
 
Best
 
 
Markus
 
 
 
 

  _  

Von: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von mardo
Gesendet: Dienstag, 3. November 2009 20:15
An: rules-users@lists.jboss.org
Betreff: Re: [rules-users] Error trying to build Drools 5.0 from source



Hi, 

similar as
http://lists.jboss.org/pipermail/rules-users/2009-October/010742.html
http://lists.jboss.org/pipermail/rules-users/2009-October/010742.html, 

I have Maven build problems for Drools 5.1 

- The projects in the reactor contain a cyclic reference . when including
-Ddocumentation in the Maven parameters 
- java.lang.StackOverflowError when excluding -Ddocumentation 

I tried both setting Java (home and path) to jdk1.5.0_19 and jdk1.6.0_10 

My MAVEN_OPTS are set to -XX:MaxPermSize=256m -Xmx1224m -Xss20m 

Do you have any suggestions? 

Thanks and best 


Markus 

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


[rules-users] Getting java.util.ConcurrentModificationException when updating a fact from Decision Tables.

2009-11-17 Thread Gurvinder Narula1
I have a decision table with one CONDITION column. My fact could match
multiple rules (rows) of the decision table. With each match, the
'ACTION' cause the fact itself to change. I'm using 'modify' as follows
to change my fact:

 

modify ($line) { addItem( new Item(DISCOUNT,25%)); } 

 

(essentially I need to add a item to a line when ever the LHS matches).

 

This works fine when I use a DRL. But when I try to use a decsion table,
I get 'java.util.ConcurrentModificationException' the second time my
fact matches a rule.

 

Does anyone know if we can modify facts from decision tables ? All the
examples I've seen so far don't show how decision tables handle updating
of facts. 

 

Here's the stack trace I get :

 

org.drools.runtime.rule.ConsequenceException:
java.util.ConcurrentModificationException

at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleEx
ception(DefaultConsequenceExceptionHandler.java:23)

at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)

at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)

at
org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1082)

at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:682)

at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemo
ry.java:649)

at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowle
dgeSessionImpl.java:177)

at
com.sample.DecisionTableTest.main(DecisionTableTest.java:31)

Caused by: java.util.ConcurrentModificationException

at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)

at java.util.AbstractList$Itr.next(AbstractList.java:343)

at com.sample.Line.addPromotion(Line.java:46)

at
com.lazboy.promotions.Rule_Group_Promotion_14_0.consequence(Rule_Group_P
romotion_14_0.java:7)

at
com.lazboy.promotions.Rule_Group_Promotion_14_0ConsequenceInvoker.evalua
te(Rule_Group_Promotion_14_0ConsequenceInvoker.java:22)

at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)

... 6 more

 

I'm using Drools Expert 5.0.1.

 

Thanks

Gurvinder

 

 

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


[rules-users] Need Syntax help for a string match

2009-11-17 Thread Lindy hagan
Need to do some tasks if customers age is in 18,21,33,28,40,41. Can't use
contains as age is a string value.Could any one help me out. Below rule does
not work.


rule Age Factor
 when
  m : Customer( age matches 18,21,33,28,40,41)
 then
 System.out.println(Customer falls in age group );
  doAgeTasks();
end

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


Re: [rules-users] Need Syntax help for a string match

2009-11-17 Thread Mauricio Salatino
Or just find how to write a regex to match all that numbers:
Using matches and http://java.sun.com/docs/books/tutorial/essential/regex/

On Tue, Nov 17, 2009 at 6:50 PM, Mauricio Salatino sala...@gmail.comwrote:

 I think that you can do something like:

 m : Customer( age == 18 || ==21 || ==33 || ==28 || ==40 ||
 ==41)

 2009/11/17 Lindy hagan lindyha...@gmail.com


 Need to do some tasks if customers age is in 18,21,33,28,40,41. Can't use
 contains as age is a string value.Could any one help me out. Below rule does
 not work.


 rule Age Factor
  when
   m : Customer( age matches 18,21,33,28,40,41)
  then
  System.out.println(Customer falls in age group );
   doAgeTasks();
 end

 Thanks,
 Lindy.

 ___
 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 -




-- 
- 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] Need Syntax help for a string match

2009-11-17 Thread Lindy hagan
Thanks for the quick reply.Will look into regex.

2009/11/17 Mauricio Salatino sala...@gmail.com

 Or just find how to write a regex to match all that numbers:
 Using matches and http://java.sun.com/docs/books/tutorial/essential/regex/


 On Tue, Nov 17, 2009 at 6:50 PM, Mauricio Salatino sala...@gmail.comwrote:

 I think that you can do something like:

 m : Customer( age == 18 || ==21 || ==33 || ==28 || ==40 ||
 ==41)

 2009/11/17 Lindy hagan lindyha...@gmail.com


 Need to do some tasks if customers age is in 18,21,33,28,40,41. Can't use
 contains as age is a string value.Could any one help me out. Below rule does
 not work.


 rule Age Factor
  when
   m : Customer( age matches 18,21,33,28,40,41)
  then
  System.out.println(Customer falls in age group );
   doAgeTasks();
 end

 Thanks,
 Lindy.

 ___
 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 -




 --
 - 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


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


Re: [rules-users] Need Syntax help for a string match

2009-11-17 Thread Jared Davis
Here are two ways to write the regular expression.

 m : Customer( age matches (18|21|33|28|40|41))

 m : Customer( age matches (18|2[18]|33|4[01]))

Did you try

m : Customer( age in (18,21,33,28,40,41))
 


I don't know which solution is faster.  I think that would
be an interesting test.








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


Re: [rules-users] Need Syntax help for a string match

2009-11-17 Thread Mauricio Salatino
@Greg
Using in is better that the multiple || == 18 ?
It has some relation with indexing?
With multiple || ==  the RETE network will generate one alpha node for
each value right?
But for in I don't imagine how it works, I also realize that it's not
included in the official docs.


On Tue, Nov 17, 2009 at 7:22 PM, Jared Davis sun...@davisprogramming.comwrote:

 Here are two ways to write the regular expression.

 m : Customer( age matches (18|21|33|28|40|41))

 m : Customer( age matches (18|2[18]|33|4[01]))

 Did you try

m : Customer( age in (18,21,33,28,40,41))



 I don't know which solution is faster.  I think that would
 be an interesting test.








 ___
 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] Need Syntax help for a string match

2009-11-17 Thread Greg Barton
The rete view for the following two rules have identical structure: (One alpha 
node in each)

rule Test
when
t : Thing( foo == BAR || == BAS );
then
System.out.println( meh );
end

rule Test
when
t : Thing( foo in(BAR,BAS) );
then
System.out.println( meh );
end

So I guess the || == conditions are combined into one node.  I can't peek 
into the source at the moment to check, though.  And I don't know which is 
faster.  I'd guess that either is faster than regex for short lists, though.

--- On Tue, 11/17/09, Mauricio Salatino sala...@gmail.com wrote:

 From: Mauricio Salatino sala...@gmail.com
 Subject: Re: [rules-users] Need Syntax help for a string match
 To: Rules Users List rules-users@lists.jboss.org
 Date: Tuesday, November 17, 2009, 3:31 PM
 @Greg
 Using in is better that the multiple || ==
 18 ?
 It has some relation with indexing?
 With multiple || ==  the RETE network will
 generate one alpha node for each value right?
 
 But for in I don't imagine how it works, I
 also realize that it's not included in the official
 docs.
 
 
 On Tue, Nov 17, 2009 at 7:22 PM,
 Jared Davis sun...@davisprogramming.com
 wrote:
 
 Here are two ways to write the
 regular expression.
 
 
 
      m : Customer( age matches
 (18|21|33|28|40|41))
 
 
 
      m : Customer( age matches
 (18|2[18]|33|4[01]))
 
 
 
 Did you try
 
 
 
     m : Customer( age in
 (18,21,33,28,40,41))
 
 
 
 
 
 
 
 I don't know which solution is faster.  I think that
 would
 
 be an interesting test.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 ___
 
 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 -
 
 
 
 -Inline Attachment Follows-
 
 ___
 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] Drools Flow 5.1.0.M1 - org.drools.audit.event.LogEvent

2009-11-17 Thread Vijay K Pandey
I was going through the org.drools.audit.event.LogEvent class and have a 
question on the following values and what kind of events they relate to - are 
they related to Human Task or something else


public static final int BEFORE_TASK_INSTANCE_CREATED= 28;
public static final int AFTER_TASK_INSTANCE_CREATED = 29;
public static final int BEFORE_TASK_INSTANCE_COMPLETED  = 30;
public static final int AFTER_TASK_INSTANCE_COMPLETED   = 31;



Thanks

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


[rules-users] Using DateFormat and getting today's date in drools5.0

2009-11-17 Thread ABRA2

I need to compare date from java bean to system date for a rule. I referred
to previous posts, drools expert documentation and tried to come up with a
rule which is not yet working. Please help me for the same.

1. Which package should i import to use DateFactory? It is not in
org.drools.base.evaluators.DateFactory anymore i guess. Is there a better
way to get CurrentSystemDate other than using DateFactory? 

2. In my JavaBean the date has format dd/MM/. So where do i set this
format to drools.dateformat? In my .drl file or in the java pgm where i load
the .drl file and do insertion of fact objects and fire the rules. 


rule SetTktIssueDate
when
DateFactory($sysdate : today )
$br:BillingRecord(tktIssueDate==null || tktIssueDate  sysdate)
then
modify($br){setTktIssueDate(sysdate);}

thanks
ABRA2

-- 
View this message in context: 
http://old.nabble.com/Using-DateFormat-and-getting-today%27s-date-in-drools5.0-tp26402736p26402736.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] Drools Flow :Persistence Problem : Restore StatefulKnowledgeSession from database

2009-11-17 Thread Pardeep . Ruhil
Hi Kris,
Thanks for you valuable input and Vijay of course clearing some of my 
doubts by asking question on this.

Much of my doubt are clear except one. 
When we are reloading the StatefulKnowledgeSession from the database using 
the below line
 
StatefulKnowledgeSession loadSession= JPAKnowledgeService.
loadStatefulKnowledgeSession(id, kbase, null, env);

This session object is different from the one that is created when we 
first created 
StatefulknowledgeSession object using 

 StatefulKnowledgeSession initialSession= JPAKnowledgeService.
newStatefulKnowledgeSession(kbase, null, env);

Am I right ?

Now In my case I have a HumanWorkItemHandler class for handling the 
humantask and there is ActionWorkITemHandler for my customAction workItem, 
which both are initailsed with the initialSession object.
Now when I load the session from the database to complete the 
HumanWorkItemHandler task I got a different session object i.e. 
loadSession. 
Now when I insert something in the loadsession using  
loadSession.insert(request); So that I can use the same in 
ActionWorkItemHandler to exceute the action for the request. 
I am not able to retrieve the same request object i.e. 
(HttpServletRequest) from the session in ActionWorkItemHandler 
as when i do 
Collection obj = loadSession.getObject();
I get request as null.   Because this loadSession is different from the 
one I have inserted.

Kindly help in this, or I have misunderstood the concept. 

Thanks  Regards

Pardeep Ruhil




Kris Verlaenen kris.verlae...@cs.kuleuven.be 
11/17/2009 04:17 PM

To
Rules Users List rules-users@lists.jboss.org, Vijay K Pandey 
vpan...@mdes.ms.gov
cc
pardeep.ru...@lntinfotech.com pardeep.ru...@lntinfotech.com
Subject
Re: [rules-users] Drools Flow :Persistence Problem : Restore 
StatefulKnowledgeSession from database






Preferably you should cache the session itself as well (so you don't
have to recreate it all the time) and reuse that across you application.
  Or you could have multiple independent sessions as well.  If you store
the key of the session somewhere, you can easily restore this session
(or sessions) after failure.

Kris

Quoting Vijay K Pandey vpan...@mdes.ms.gov:

 Let's say where we don't need timers - in those cases one can create
 (create only if its not there) a global session (create the
 sessioninfo at the drools startup - store the session primary key
 somewhere) - reuse this session across everywhere?
 
 Vijay
 -Original Message-
 From: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Kris
 Verlaenen
 Sent: Monday, November 16, 2009 5:12 PM
 To: Rules Users List; pardeep.ru...@lntinfotech.com
 Subject: Re: [rules-users] Drools Flow :Persistence Problem : Restore
 StatefulKnowledgeSession from database
 
 Pardeep,
 
 The behavior you are describing is indeed correct.  The session in
 this
 case is a global session, meaning that it will be used for all
 process
 instances.  Note however that, unless you are using timers, all
 other
 state (process instance state, work items, etc.) is persisted
 separately
 and the session state will basically be empty.
 
 It is also possible to have one session per process instance (or
 whatever partitioning you like).  A session has a unique id (which
 you
 can specify when reloading the session).  You'll then have to load
 the
 right session before continuing the execution of your process
 instance.
 
 Kris
 
 Quoting pardeep.ru...@lntinfotech.com:
 
  Hi Salaboy,
  Thanks for you replying.
  Yes, of course it is storing multiple process instance Id in the
  database.
  But, what I feel is that it will fail when I am trying to run two
  workflow
  at the same time simultaneously, using the same code by
 dynamically
  providing the workflow name and the parameters for each of them.
  Ideally there should be two entries for the
 StatfulKnowledgeSession
  object
  because when I try to load the StatefulKnowledgeSession object
 from
  the
  database it will give me the session object of the workflow which
 is
  last
  executed.
 
  For example lets  suppose I have two workflow 1 and 2 having two
  humantask
  in each of them . So when I finish the first Human Task of both
  workflow
  one by one.  SessionInfo  present in the database is of workflow 2
  (if 2
  is executed last). Because there is no field in the sessioninfo
  entity of
  the database regarding to which workflow it belongs to. Am I right
 ?
  So when I  try to finish the 1st workflow by executing the 2nd
  humantask
  left in it , I need to reload the StatfulKnowledgeSession object
 from
  the
  database. As there is no way of distinguishing that the session
  object
  store in the database is of which workflow , there might be a
 problem
  as I
  may get the ksession object of 2nd workflow.
 
  In case of Process Instance it is fine , because there is a field
  'processId' which will distinguish which processInstanceId belongs
 to
 
  which