This page last changed on Jan 29, 2015 by ludodoucet.

Hello,

I would like to have the number of the day today , for example today we are Thursday , I want to get 4.
I choose a day from the 7 a week. I triggered the events the day before or not.
My debian have locale fr_FR but show Thursday, I've seen "mercredi" yesterday.

My current code, a bit messy sorry:

/////////////////
rule "JourJeudi"
timer (cron: 0 0/1 * * * ?)
when

CustomState( source == "DisplJourSemaine", value== "Thursday" ) ///// NOT WORK but it walking when i've seen "mercredi" yesterday.
then
execute.command( "DisplayNoJourDeLaSemaine", 4 );
end
/////////////// WORK:
rule "veille du retour"
timer (cron: 0 0/1 * * * ?)
when
CustomState(source=="GVJourRetour", $jr:value)
CustomState(source=="DisplayNoJourDeLaSemaine", $dms:value )
then
// veille du retour
log("assignation du declencheur veille");
Integer DeclencheurV = Integer.parseInt($jr.toString()) - Integer.parseInt($dms.toString());

execute.command("DeclencheurVeilleInt", DeclencheurV );

end

rule "pas delester"
timer (cron: 0 0 21 * * ?)

when
Range(source=="DeclencheurVeilleInt", value== 1)
log("ne pas delester retour demain");

execute.command("GVJourRetour", 100 );
end
//////////////////WORK

/////////// dev.log:
2015-01-29 08:14:22,489 TRACE [Polling thread for sensor: Display JourDeLaSemaine]: Processed 'Thursday', received 'Thursday' ///////// Date time format EEEE
////////////

Do you have an idea to do that in drools? DayToDay to integer?

Thank you.

I'll try to build from source , maybe the local parameters of the controller does not correspond to my parameters on my linux install.
en_US for openremote
fr_FR for linux
I had to install 2.1 from zip.

After coming back to you , if you have an idea , to have the result by a line of code drl , I am always taking .

Posted by ludodoucet at Jan 30, 2015 09:21

I solved my problem by compiling from source , it works

Posted by ludodoucet at Feb 06, 2015 06:28
Document generated by Confluence on Jun 05, 2016 09:35