Re: [rules-users] Startup KIE Workbench without network connection

2014-05-15 Thread Ioannis Christodoulou
Hello,
you probably need to set:
-Dorg.kie.demo=false and -Dorg.kie.example=false in your startup variables.

For example, using jboss, I have in standalone.conf file (used during jboss
startup)
JAVA_OPTS="$JAVA_OPTS -Dorg.kie.demo=false -Dorg.kie.example=false
This will disable the demo and the example sources from the workbench.


Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Thu, May 15, 2014 at 6:27 PM, Sandjaja, Dominik <
dominik.sandj...@it-motive.de> wrote:

>  Hello,
>
>
>
> I try to setup KIE Workbench (6.1.0.BetaX) on Tomcat 7 on a Windows 2012
> Server without connection to the internet.
>
>
>
> When starting up, the KIE-WB does not start up. I get the following errors
> in localhost.log (cut for better readability):
>
>
>
> Mai 15, 2014 5:08:18 PM org.apache.catalina.core.StandardContext
> listenerStart
>
> Schwerwiegend: Exception sending context initialized event to listener
> instance of class org.jboss.weld.environment.servlet.Listener
>
> org.jboss.weld.exceptions.DeploymentException: Exception List with 1
> exceptions:
>
> […]
>
> Caused by: java.lang.RuntimeException:
> https://github.com/guvnorngtestuser1/guvnorng-playground.git: cannot open
> git-upload-pack
>
> […]
>
> Caused by: java.net.ConnectException: Connection time out: github.com
>
>
>
> This happens because the initial demo repository is downloaded – I do not
> want and need those repositories!
>
>
>
> I could work around this by copying the TOMCAT_HOME/bin/.niogit directory
> to that server and have it start up then.
>
>
>
> BUT: IMHO it is an inconvenience, maybe even a bug, that an internet
> connection is needed to set up the Drools KIE Workbench. How are we
> supposed to tell our infrastructure team that we need an open connection to
> “some website with code” to setup an editing system for internal knowledge …
>
> Should I file a bug for that? Is there a way to deactivate the downloading
> of the initial demo repository? Could it somehow be delivered with the
> KIE-WB package?
>
>
>
> Thanks
>
> Dominik
>
> …
> mit freundlichen Grüßen / kind regards
> Dominik Sandjaja
> Fon: +49 (0) 203 60878 183
> Fax: +49 (0) 203 60878 222
> e-mail: dominik.sandj...@it-motive.de
>
> it-motive AG
> Zum Walkmüller 6
> 47269 Duisburg
> i...@it-motive.de
> http://www.it-motive.de
> ……
> Vorsitzender des Aufsichtsrats: Dr.-Ing. Jürgen Sturm
> Vorstand: Horst-Dieter Deelmann (Vors.), Matthias Heming, Christoph Tim
> Klose
> HRB 9207, Amtsgericht Duisburg
>
> ___
> 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] Editing Action in Guided decision table ruins the action.

2014-03-27 Thread Ioannis Christodoulou
Hello everyone,
I'm using the latest stable kie workbench (6.0.1.Final) and I have created
a guided decision table containing an action with free form brl.

Whenever I try to edit this action and press apply changes, kie workbench
will duplicate the action (creating the new/edited action, while keeping
the old one) and will not allow me to remove (by clicking on the minus
icon) the old action.

If I try to validate the guided decision table, I get an error saying
"Unable to complete your request. The following exception occurred: rowData
contains a different number of columns to those provided".

The only solution I found is to remove the action that I need to edit and
re-create it. But this means that I have to re-enter the parameters in my
rules.

Example action:
/*MyUtils is a custom class and I am calling a static method passing
arguments: a string taken as a parameter from each rule and a Level object
matched in the rule.
*/
MyUtils.calculateLevel( "@{level_value}", $level);

The issue appears if I try to change that by clicking on the edit (pencil)
icon to (or any other change actually):
MyUtils.calculateLevel("@{level_value}", "@{another_value}", $level);

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

Re: [rules-users] cannot copy guided decision table

2014-03-21 Thread Ioannis Christodoulou
ah great thanks!

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Fri, Mar 21, 2014 at 3:47 PM, Michael Anstis wrote:

> This has been fixed in the next release.
>
> You can download the sources and build locally if you want the fix sooner.
>
>
> On 21 March 2014 11:35, Ioannis Christodoulou wrote:
>
>> I tried to copy a guided decision table in kie workbench 6.0.1.Final
>> It created the new decision table, but the generated drl (which can be
>> viewed from the 'source' tab)
>> cannot be validated, because the generated rule names are the same with
>> the copied decision table.
>> For example, copying the guided decision table: guided_decision_table.gdst
>> to rules2.gdst will not change the generated rules names, they will still
>> be:
>> rule "Row 1 guided_decision_table".
>>
>> Is there something I can do about it ?
>>
>> ___
>> 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] cannot copy guided decision table

2014-03-21 Thread Ioannis Christodoulou
I tried to copy a guided decision table in kie workbench 6.0.1.Final
It created the new decision table, but the generated drl (which can be
viewed from the 'source' tab)
cannot be validated, because the generated rule names are the same with the
copied decision table.
For example, copying the guided decision table: guided_decision_table.gdst
to rules2.gdst will not change the generated rules names, they will still
be:
rule "Row 1 guided_decision_table".

Is there something I can do about it ?
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Rules updating error

2014-03-20 Thread Ioannis Christodoulou
Actually any change that builds another package will cause the kiescanner
to report errors on analysing the 'myFunctionCall(myGlobalList);'
expression.
e.g. change
System.out.println("List contains:"+list);  ===> System.out.println("Global
List Variable contains:"+list);

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Thu, Mar 20, 2014 at 11:46 PM, Michael Anstis
wrote:

> Are those the initial definitions?
>
> What changes to cause KieScanner to report errors?
>
> Sent on the move
> On 20 Mar 2014 21:34, "Ioannis Christodoulou" 
> wrote:
>
>> I can't really make a unit test, but I can provide example drl:
>> Assuming that the rule project contains a guided decision table and a drl
>> file:
>> Guided Decision Table producing drl:
>> rule "guided rule"
>> when
>> then
>>   myFunctionCall(myGlobalList);
>> end
>>
>> The drl file:
>> import java.util.List;
>> global java.util.List myGlobalList;
>>
>> function void myFunctionCall(List aList) {
>>   System.out.println("List contains:"+list);
>> }
>>
>> the rules are initiated by calling:
>> KieSession ksession = 
>> List globalList = new ArrayList();
>> ksession.setGlobal("myGlobalList", globalList);
>>
>> On Thu, Mar 20, 2014 at 9:23 PM, Michael Anstis > > wrote:
>>
>>> Ok.
>>>
>>> You are correct (1) is a known issue that I am working on at the moment.
>>>
>>> Can you give illustrative DRL for the original rule and updated rule
>>> that causes problems for (2). It would help understand what could be the
>>> cause (or submit a pull request containing a unit test).
>>>
>>> Sent on the move
>>> On 20 Mar 2014 19:20, "Ioannis Christodoulou" 
>>> wrote:
>>>
>>>> Well, only the second actually, since my understanding (from a previous
>>>> question I sent) is that the first is a known thing (issue?).
>>>> KieScanner loads the rules project without any issues the first time
>>>> (upon application startup) but shows a validation error if the rules
>>>> project is updated (minor update, definitely not causing a validation
>>>> error),
>>>> reporting that it cannot Analyze the expressions involving the global
>>>> variable and the function.
>>>>
>>>> Ευχαριστώ πολύ,
>>>>Ιωάννης Χριστοδούλου
>>>>
>>>>
>>>> On Thu, Mar 20, 2014 at 9:02 PM, Michael Anstis <
>>>> michael.ans...@gmail.com> wrote:
>>>>
>>>>> From what I can gather from your email there are two problems. Please
>>>>> confirm and then we can comment further:
>>>>>
>>>>> (1) Validation of a guided decision table, that uses a global, reports
>>>>> a validation error.
>>>>>
>>>>> (2) Changes to the decision table's use of a global is not being
>>>>> detected bt KieScanner.
>>>>>
>>>>> Sent on the move
>>>>> On 20 Mar 2014 11:28, "Ioannis Christodoulou" 
>>>>> wrote:
>>>>>
>>>>>> In my java ee application, I use drools 6.1.0.Beta1, deployed on
>>>>>> jboss eap 6.2 (I have also deployed Kie Workbench 6.0.1.Final).
>>>>>>
>>>>>> In order to get the latest updates on my rules (made on kie wb) I
>>>>>> tried to set kiescanner to "LATEST". This seems to not be working always
>>>>>> (I'm not 100% sure about the reason, it seems to happen when I have not
>>>>>> re-deployed the jar with the model classes I use in my rules, or I have 
>>>>>> not
>>>>>> clicked on build&deploy of the rules project), so I have reverted to 
>>>>>> using
>>>>>> "1.0" as the version and not changing the version when I update the rules
>>>>>> project.
>>>>>>
>>>>>> There is an issue with the application not validating, because I have
>>>>>> a guided decision table which uses a global variable and a function, but
>>>>>> that seems to not be an error after all (everything seems to build as it
>>>>>> should).
>>>>>>
>>>>>> However, while my application is running (and watching for updates
>>>>>> through scanner), if I make an update and deploy the rules project again,
>>>>>

Re: [rules-users] Rules updating error

2014-03-20 Thread Ioannis Christodoulou
I can't really make a unit test, but I can provide example drl:
Assuming that the rule project contains a guided decision table and a drl
file:
Guided Decision Table producing drl:
rule "guided rule"
when
then
  myFunctionCall(myGlobalList);
end

The drl file:
import java.util.List;
global java.util.List myGlobalList;

function void myFunctionCall(List aList) {
  System.out.println("List contains:"+list);
}

the rules are initiated by calling:
KieSession ksession = 
List globalList = new ArrayList();
ksession.setGlobal("myGlobalList", globalList);

On Thu, Mar 20, 2014 at 9:23 PM, Michael Anstis wrote:

> Ok.
>
> You are correct (1) is a known issue that I am working on at the moment.
>
> Can you give illustrative DRL for the original rule and updated rule that
> causes problems for (2). It would help understand what could be the cause
> (or submit a pull request containing a unit test).
>
> Sent on the move
> On 20 Mar 2014 19:20, "Ioannis Christodoulou" 
> wrote:
>
>> Well, only the second actually, since my understanding (from a previous
>> question I sent) is that the first is a known thing (issue?).
>> KieScanner loads the rules project without any issues the first time
>> (upon application startup) but shows a validation error if the rules
>> project is updated (minor update, definitely not causing a validation
>> error),
>> reporting that it cannot Analyze the expressions involving the global
>> variable and the function.
>>
>> Ευχαριστώ πολύ,
>>Ιωάννης Χριστοδούλου
>>
>>
>> On Thu, Mar 20, 2014 at 9:02 PM, Michael Anstis > > wrote:
>>
>>> From what I can gather from your email there are two problems. Please
>>> confirm and then we can comment further:
>>>
>>> (1) Validation of a guided decision table, that uses a global, reports a
>>> validation error.
>>>
>>> (2) Changes to the decision table's use of a global is not being
>>> detected bt KieScanner.
>>>
>>> Sent on the move
>>> On 20 Mar 2014 11:28, "Ioannis Christodoulou" 
>>> wrote:
>>>
>>>> In my java ee application, I use drools 6.1.0.Beta1, deployed on jboss
>>>> eap 6.2 (I have also deployed Kie Workbench 6.0.1.Final).
>>>>
>>>> In order to get the latest updates on my rules (made on kie wb) I tried
>>>> to set kiescanner to "LATEST". This seems to not be working always (I'm not
>>>> 100% sure about the reason, it seems to happen when I have not re-deployed
>>>> the jar with the model classes I use in my rules, or I have not clicked on
>>>> build&deploy of the rules project), so I have reverted to using "1.0" as
>>>> the version and not changing the version when I update the rules project.
>>>>
>>>> There is an issue with the application not validating, because I have a
>>>> guided decision table which uses a global variable and a function, but that
>>>> seems to not be an error after all (everything seems to build as it 
>>>> should).
>>>>
>>>> However, while my application is running (and watching for updates
>>>> through scanner), if I make an update and deploy the rules project again,
>>>> the application retrieves the update and fails with a validation error
>>>> about not being able to analyse the expressions regarding the global
>>>> function and the global variable.
>>>>
>>>> Any suggestions?
>>>>
>>>> Thank you very much.
>>>>
>>>>
>>>> ___
>>>> 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Rules updating error

2014-03-20 Thread Ioannis Christodoulou
Well, only the second actually, since my understanding (from a previous
question I sent) is that the first is a known thing (issue?).
KieScanner loads the rules project without any issues the first time (upon
application startup) but shows a validation error if the rules project is
updated (minor update, definitely not causing a validation error),
reporting that it cannot Analyze the expressions involving the global
variable and the function.

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Thu, Mar 20, 2014 at 9:02 PM, Michael Anstis wrote:

> From what I can gather from your email there are two problems. Please
> confirm and then we can comment further:
>
> (1) Validation of a guided decision table, that uses a global, reports a
> validation error.
>
> (2) Changes to the decision table's use of a global is not being detected
> bt KieScanner.
>
> Sent on the move
> On 20 Mar 2014 11:28, "Ioannis Christodoulou" 
> wrote:
>
>> In my java ee application, I use drools 6.1.0.Beta1, deployed on jboss
>> eap 6.2 (I have also deployed Kie Workbench 6.0.1.Final).
>>
>> In order to get the latest updates on my rules (made on kie wb) I tried
>> to set kiescanner to "LATEST". This seems to not be working always (I'm not
>> 100% sure about the reason, it seems to happen when I have not re-deployed
>> the jar with the model classes I use in my rules, or I have not clicked on
>> build&deploy of the rules project), so I have reverted to using "1.0" as
>> the version and not changing the version when I update the rules project.
>>
>> There is an issue with the application not validating, because I have a
>> guided decision table which uses a global variable and a function, but that
>> seems to not be an error after all (everything seems to build as it should).
>>
>> However, while my application is running (and watching for updates
>> through scanner), if I make an update and deploy the rules project again,
>> the application retrieves the update and fails with a validation error
>> about not being able to analyse the expressions regarding the global
>> function and the global variable.
>>
>> Any suggestions?
>>
>> Thank you very much.
>>
>>
>> ___
>> 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] Rules updating error

2014-03-20 Thread Ioannis Christodoulou
In my java ee application, I use drools 6.1.0.Beta1, deployed on jboss eap
6.2 (I have also deployed Kie Workbench 6.0.1.Final).

In order to get the latest updates on my rules (made on kie wb) I tried to
set kiescanner to "LATEST". This seems to not be working always (I'm not
100% sure about the reason, it seems to happen when I have not re-deployed
the jar with the model classes I use in my rules, or I have not clicked on
build&deploy of the rules project), so I have reverted to using "1.0" as
the version and not changing the version when I update the rules project.

There is an issue with the application not validating, because I have a
guided decision table which uses a global variable and a function, but that
seems to not be an error after all (everything seems to build as it should).

However, while my application is running (and watching for updates through
scanner), if I make an update and deploy the rules project again, the
application retrieves the update and fails with a validation error about
not being able to analyse the expressions regarding the global function and
the global variable.

Any suggestions?

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

Re: [rules-users] 6.0.1.F How to set Maven repo used by KieScanner?

2014-03-19 Thread Ioannis Christodoulou
I am experiencing the same issue using the 6.1.0.Beta1 version (with the
LATEST version not being found), so I am catching that exception and
retrying it for a specific version (1.0).

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Thu, Mar 20, 2014 at 12:10 AM, Joe White wrote:

> Then you are set. I'm pretty sure that the LATEST feature is enabled in
> the 6.1 release so you might try the beta if you need it.
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of SrjTx
> Sent: Wednesday, March 19, 2014 3:09 PM
> To: rules-users@lists.jboss.org
> Subject: Re: [rules-users] 6.0.1.F How to set Maven repo used by
> KieScanner?
>
> actually, if I use the version number I do see the following (missed it
> last time I looked), but no rules fire.
> 16:04:08,127 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl]
> (http-/10.1.1.161:8443-2) KieModule was added:MemoryKieModule[
> ReleaseId=com.xxx.policy:cep:1.0]
>
> We had been doing this with switchyard and had to use "latest" so that it
> would pick up changes made in kie-wb.
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/6-0-1-F-How-to-set-Maven-repo-used-by-KieScanner-tp4028804p4028812.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] function in guided decision table

2014-03-17 Thread Ioannis Christodoulou
Nope, I still have a problem after building and deploying the project
(without validation, since that would fail).
When my application receives the new package, an exception is thrown saying:
unable to resolve method using strict-mode:
org.drools.core.spi.KnowledgeHelper.logRule

My action from the decision table is quite simple:
logRule("@{rule}", $level); //level is a class from my application
and in the row (the rule) I set it to .

The drl contains (only) the function:
function void logRule(String rule, Level level) {
System.out.println("Matched rule: "+rule+" for level:"+level);
}

I tried to call the function using FunctionName.functionName pattern, as
well as .FunctionName.functionName pattern, without any
success.

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Mon, Mar 17, 2014 at 2:58 PM, Michael Anstis wrote:

> OK.
>
> If validation failed, this is a known issue - we just validate the single
> decision table without including "external" resources (such as the
> function, if a different DRL file).
>
> If you save the decision table it should be OK - i.e. no errors shown in
> the "Problems Panel" (this is because this uses a different mechanism to
> the "validation" function).
>
> The issue is recorded here:
> https://bugzilla.redhat.com/show_bug.cgi?id=1075039 and a related one
> here: https://bugzilla.redhat.com/show_bug.cgi?id=1071205
>
>
> On 17 March 2014 12:01, Ioannis Christodoulou wrote:
>
>> Yes, I cannot find any possible way to declare a function.
>>
>> So, I declared it inside a dlr file (the validation succeeded) and tried
>> to call it from the 'action' column of the guided decision table.
>> The validation on the guided decision table failed, saying that it could
>> not analyze the function call expression.
>>
>> Ευχαριστώ πολύ,
>>Ιωάννης Χριστοδούλου
>>
>>
>> On Mon, Mar 17, 2014 at 12:45 PM, Michael Anstis <
>> michael.ans...@gmail.com> wrote:
>>
>>> "The problem is that I cannot find a way to declare the function and
>>> make it visible from the guided"
>>>
>>> What does this mean exactly? Are you getting a validation error when
>>> clicking the "validate" button? Did you expect to see a function listed
>>> somewhere?
>>>
>>>
>>> On 17 March 2014 10:25, Ioannis Christodoulou wrote:
>>>
>>>> Hello everyone.
>>>> I'm using the latest kie workbench and I have created a guided decision
>>>> table.
>>>> I want to create a function and call it from an action of the guided
>>>> decision table.
>>>>
>>>> The problem is that I cannot find a way to declare the function and
>>>> make it visible from the guided
>>>> decision table. I have tried declaring it in a drl file, as well as in
>>>> a dsl definition without success (the error is that drools cannot analyze
>>>> the function call expression).
>>>>
>>>> Has anyone solved this issue before?
>>>>
>>>> Kind regards.
>>>>
>>>> ___
>>>> 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] function in guided decision table

2014-03-17 Thread Ioannis Christodoulou
Yes, I cannot find any possible way to declare a function.

So, I declared it inside a dlr file (the validation succeeded) and tried to
call it from the 'action' column of the guided decision table.
The validation on the guided decision table failed, saying that it could
not analyze the function call expression.

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Mon, Mar 17, 2014 at 12:45 PM, Michael Anstis
wrote:

> "The problem is that I cannot find a way to declare the function and make
> it visible from the guided"
>
> What does this mean exactly? Are you getting a validation error when
> clicking the "validate" button? Did you expect to see a function listed
> somewhere?
>
>
> On 17 March 2014 10:25, Ioannis Christodoulou wrote:
>
>> Hello everyone.
>> I'm using the latest kie workbench and I have created a guided decision
>> table.
>> I want to create a function and call it from an action of the guided
>> decision table.
>>
>> The problem is that I cannot find a way to declare the function and make
>> it visible from the guided
>> decision table. I have tried declaring it in a drl file, as well as in a
>> dsl definition without success (the error is that drools cannot analyze the
>> function call expression).
>>
>> Has anyone solved this issue before?
>>
>> Kind regards.
>>
>> ___
>> 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] function in guided decision table

2014-03-17 Thread Ioannis Christodoulou
Hello everyone.
I'm using the latest kie workbench and I have created a guided decision
table.
I want to create a function and call it from an action of the guided
decision table.

The problem is that I cannot find a way to declare the function and make it
visible from the guided
decision table. I have tried declaring it in a drl file, as well as in a
dsl definition without success (the error is that drools cannot analyze the
function call expression).

Has anyone solved this issue before?

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

Re: [rules-users] Temporal rules in decision table

2014-03-12 Thread Ioannis Christodoulou
Amazing!
thanks a lot Wolfgang!

Kind regards

On Wed, Mar 12, 2014 at 10:27 AM, Wolfgang Laun wrote:

> You can create a rule with a timer to update Current with the required
> frequency.
>
> rule "set current"
>timer (int: 1s 1s)
>no-loop
> when
>$c: Current()
> then
>modify( $c ){ setXYZ(whatever) }
> end
>
>
>
> On 11/03/2014, Ioannis Christodoulou  wrote:
> > Thanks a lot for the prompt reply and the detailed example!
> > It took me some time but I managed to convert it to a working xls
> decision
> > table.
> >
> > Now, I wanted to figure out how to automatically update the Current
> object
> > regularly, in order to re-calculate the rules over time.
> > My application is a java ee one. Would creating a @schedule on a
> singleton
> > method be a good solution, or is there another better advice for it?
> >
> > Thanks again!
> >
> > Ευχαριστώ πολύ,
> >Ιωάννης Χριστοδούλου
> >
> >
> > On Tue, Mar 11, 2014 at 8:50 PM, Wolfgang Laun
> > wrote:
> >
> >> As you have Level with a field date, you can access that point in time
> in
> >> milliseconds, using getTimeInMillis(). For the current time, you might
> >> insert an object of class Current with a member now of class Calendar.
> >>
> >> rule closest
> >> when
> >> Current( $now: now )
> >> $level: Level( $value == 2, $date: date )
> >> not $x: Level( Math.abs( $x.getDate().getTimeInMillis() -
> >> $now.getTimeInMillis() ) < Math.abs( $date.getTimeInMillis() -
> >> $now.getTimeInMillis() ) )
> >> then
> >> // $level is the Level fact closest to Current with a level of 2
> >> end
> >>
> >> Untested. If the long expression gives you trouble, try enclosing it in
> >> eval(...).
> >> -W
> >>
> >>
> >> On 11 March 2014 18:14, JChrist  wrote:
> >>
> >>> Hello everyone,
> >>> I was messing with drools v6.0.1.Final the past week and I have not
> been
> >>> able to completely understand how to integrate the rule engine to my
> >>> specification.
> >>>
> >>> For the needs of my project, I want to regularly insert some data in
> the
> >>> engine, similar to the following:
> >>> class Level { double value;Calendar date; }
> >>> this class contains some values at specific time points (both in the
> >>> past
> >>> and in the future).
> >>>
> >>> I would like to be able create a decision table based on the "current"
> >>> time
> >>> (plus or minus a variable offset) and the value of the closest Level to
> >>> that
> >>> time point.
> >>>
> >>> For example, assuming it is '2014-11-03 19:10:00' and the level objects
> >>> in
> >>> the session currently are:
> >>> '1.0 2014-11-03 18:00:00' and '2.0 2014-11-03 19:00:00',
> >>>
> >>> I would want a rule to say that if current level value is 2.0 then do
> >>> some
> >>> stuff and it would make a match.
> >>>
> >>> I would really appreciate any help on how to overcome this issue, as
> >>> well
> >>> as
> >>> any good examples/tutorials regarding this.
> >>>
> >>> Kind regards.
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://drools.46999.n3.nabble.com/Temporal-rules-in-decision-table-tp4028638.html
> >>> Sent from the Drools: User forum mailing list archive at Nabble.com.
> >>> ___
> >>> rules-users mailing list
> >>> rules-users@lists.jboss.org
> >>> https://lists.jboss.org/mailman/listinfo/rules-users
> >>>
> >>
> >>
> >> ___
> >> rules-users mailing list
> >> rules-users@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
>
> ___
> 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] Temporal rules in decision table

2014-03-11 Thread Ioannis Christodoulou
Thanks a lot for the prompt reply and the detailed example!
It took me some time but I managed to convert it to a working xls decision
table.

Now, I wanted to figure out how to automatically update the Current object
regularly, in order to re-calculate the rules over time.
My application is a java ee one. Would creating a @schedule on a singleton
method be a good solution, or is there another better advice for it?

Thanks again!

Ευχαριστώ πολύ,
   Ιωάννης Χριστοδούλου


On Tue, Mar 11, 2014 at 8:50 PM, Wolfgang Laun wrote:

> As you have Level with a field date, you can access that point in time in
> milliseconds, using getTimeInMillis(). For the current time, you might
> insert an object of class Current with a member now of class Calendar.
>
> rule closest
> when
> Current( $now: now )
> $level: Level( $value == 2, $date: date )
> not $x: Level( Math.abs( $x.getDate().getTimeInMillis() -
> $now.getTimeInMillis() ) < Math.abs( $date.getTimeInMillis() -
> $now.getTimeInMillis() ) )
> then
> // $level is the Level fact closest to Current with a level of 2
> end
>
> Untested. If the long expression gives you trouble, try enclosing it in
> eval(...).
> -W
>
>
> On 11 March 2014 18:14, JChrist  wrote:
>
>> Hello everyone,
>> I was messing with drools v6.0.1.Final the past week and I have not been
>> able to completely understand how to integrate the rule engine to my
>> specification.
>>
>> For the needs of my project, I want to regularly insert some data in the
>> engine, similar to the following:
>> class Level { double value;Calendar date; }
>> this class contains some values at specific time points (both in the past
>> and in the future).
>>
>> I would like to be able create a decision table based on the "current"
>> time
>> (plus or minus a variable offset) and the value of the closest Level to
>> that
>> time point.
>>
>> For example, assuming it is '2014-11-03 19:10:00' and the level objects in
>> the session currently are:
>> '1.0 2014-11-03 18:00:00' and '2.0 2014-11-03 19:00:00',
>>
>> I would want a rule to say that if current level value is 2.0 then do some
>> stuff and it would make a match.
>>
>> I would really appreciate any help on how to overcome this issue, as well
>> as
>> any good examples/tutorials regarding this.
>>
>> Kind regards.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Temporal-rules-in-decision-table-tp4028638.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users