Resuable Sub Process From Eclipse to Guvnor
by Amin Mohammed-Coleman
Hi
I tried pushing a bpmn definition from eclipse to Guvnor and it contained a resuable sub process. When I view the definition in Guvnor I don't see the resuable sub process. All I see are connections to but not connected to anything. Has anyone else experienced this?
Thanks
14 years, 1 month
Can I capture the result of an RMI call within a pattern?
by lhorton
5.2.0.Final
consider this simplified example, which has RMI calls to a service to
getLocation()
rule "example"
when
$p : Product( location != remoteService.getLocation("A") )
then
$p.setLocation( remoteService.getLocation("A") );
end
the above rule calls the remote method twice, once in the LHS to compare to
a current value, and again in the RHS to set the value. I would like to
capture the return value of the LHS call, to avoid making the call twice. I
haven't been able to figure out the syntax to do this within the pattern.
Here's one example of what I have tried:
rule "example"
when
$p : Product( location != $loc : remoteService.getLocation("A") )
then
$p.setLocation( $loc );
end
Does anyone know the correct syntax to accomplish this? Or am I trying to
do the impossible?
--
View this message in context: http://drools.46999.n3.nabble.com/Can-I-capture-the-result-of-an-RMI-call...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
Using planner to create an optimized changeset
by Anton Hughes
Im interested in using Drools Planner to set the salience of a changeset, or
possibly create a new changeset.
So, using the Traveling salesmen problem, but this time the goal is
to reduce
the cost of the trip, we have a collection of rules, like (will write in
english rather than MVEL)
when traveling during holiday period
when traveling to London avoid Heathrow
when traveling more than 8 hours upgrade to business class ( so the
salesperson
is fresh)
when flying into NYC stay at xyz hotel
Would it be possible - or can anyone suggest ways of - generating a
changeset
(using Planner) of rules from another changeset, where the salience is
set, and/or rules are added/removed?
Thanks for you help. And very interested to hear your feedback.
14 years, 1 month
Data comparing in CONDITION column decision table
by Sumeet Karawal
Hi,
Can we use a data value of another object in the condition column of a
Spreadsheet.
For example: I have two data types(POJOs) one com.bank.Customer and other
com.bank.Account
in the rules I want to check whether the value entered for a particular
field in Customer class is equal to the value entered for the corresponding
field in the Account class. eg Customer.accType = Account.accType()
How can we achieve this using Decision table (CONDITION Column). I have
tried this:
--------------------------------------------
|RuleTable
|Discount
--------------------------------------------
|CONDITION |CONDITION |
---------------+----------------------------|
|$a : Account |$c : Customer |
---------------+----------------------------|
| |type == "$param"
----------+---------------+----------------------------
| Discount | Account | Type |
| Rules | | |
|----------+---------------+----------------------------|
| 1 | | $a.getType() |
|----------+---------------+----------------------------|
| 2 | | $a.getType() |
|----------+---------------+----------------------------|
| 3 | | $a.getType() |
|----------+---------------+----------------------------|
| 4 | | $a.getType() |
|----------+---------------+----------------------------|
| 5 | | $a.getType() |
|----------+---------------+----------------------------|
| 6 | | $a.getType() |
|----------+---------------+----------------------------|
But it won't work. It would be great if somebody could help me on this.
Thanks & Regards,
Sumeet Karawal
Mailto: sumeet.karawal(a)tcs.com
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
14 years, 1 month
Guvnor and DB2
by Amin Mohammed-Coleman
Hi
I am trying to integrate Drools Guvnor and DB2 however I'm struggling to get it to work. After changing the repository XML I seem to firstly get:
DbUtility.java:logException failed to close statement Reason already closed.
Followed by nosuchnodetype exception packagenodetype
The db permissions are correct I've confirmed with a separate app.
Any advice would be appreciated.
Thanks
Amin
Sent from my iPhone
14 years, 1 month
List<String> wrongly coerced to Object
by aitchnyu
I want to compare two List<String>'s if they have elements in common. I made
the following rule (actually two of them):
*----rule----*
rule "hardConflictIsIn"
when
$hc : HardConstraint(
$attribute : attribute,
operator == "is in",
$values : strAttributeValue,
$period : period
)
$stp : SubjectTeacherPeriod(
period == $period,
//Collections.disjoint( $t.attributes["tags"], values_list)
eval( Collections.disjoint( *strAttributeMap.get($attribute)*,
$values) == false )
)
then
insertLogical(new IntConstraintOccurrence("hardConflictIsIn",
ConstraintType.NEGATIVE_HARD,1,
$hc,$stp));
end
*----rule----*
But I get the following error:
*----error----*
Exception in thread "main" java.lang.IllegalStateException: There are errors
in the scoreDrl's:
Rule Compilation error : [Rule name='hardConflictNotIn']
in/co/technovia/timetabler/domain/Rule_hardConflictNotIn_8b50378322e744d883618db9941a8e66.java
(9:1204) : The method disjoint(Collection<?>, Collection<?>) in the type
Collections is not applicable for the arguments (*Object*, List)
Rule Compilation error : [Rule name='hardConflictIsIn']
in/co/technovia/timetabler/domain/Rule_hardConflictIsIn_d7f4ca0884754cf894e7cbdb96cee30e.java
(9:1203) : The method disjoint(Collection<?>, Collection<?>) in the type
Collections is not applicable for the arguments (Object, List)
at
org.drools.planner.config.solver.SolverConfig.buildRuleBase(SolverConfig.java:238)
at
org.drools.planner.config.solver.SolverConfig.buildSolver(SolverConfig.java:170)
at
org.drools.planner.config.XmlSolverConfigurer.buildSolver(XmlSolverConfigurer.java:103)
at
in.co.technovia.timetabler.TimeTableApp.createSolver(TimeTableApp.java:61)
at in.co.technovia.timetabler.TimeTableApp.main(TimeTableApp.java:45)
*----error----*
So something get'ted from the map SubjectTeacherPeriod.strAttributeMap is
wrongly coerced to an Object? I defined my SubjectTeacherPeriod class this
way:
*----class snippet----*
public class SubjectTeacherPeriod{
...
private Map<String, Integer> num_attribute_map = new HashMap<String,
Integer>();
private Map<String,List<String>> str_attribute_map = new
HashMap<String,List<String>>();
...
public Map<String,List<String>> getStrAttributeMap(){
return this.str_attribute_map;
}
...
*----class snippet----*
How can I fix this?
--
View this message in context: http://drools.46999.n3.nabble.com/List-String-wrongly-coerced-to-Object-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
Trouble with the MVEL Map syntax
by barnesjd
I'm interested in using the
http://mvel.codehaus.org/Inline+List,+Maps+and+Arrays compact syntax
available for Maps in MVEL , but I can't quite get it right. I am
attempting to write a simple function to convert English numbers (i.e.
"one", "two", etc) to the integer value. This is how I would LIKE it to
work:
/function int englishToInt(String englishNumber)
{
return ["one":1, "two":2, "three":3, "four":4,
"five":5].get(englishNumber.toLowerCase());
}/
The closest I've gotten to having it work is this:
/function int englishToInt(String englishNumber)
{
Map m = ["one":1, "two":2, "three":3, "four":4, "five":5];
Object obj = m.get(englishNumber.toLowerCase());
if(obj != null)
return Integer.parseInt(obj.toString());
}/
But I get this rather unhelpful error message:
/
Error importing : 'defaultpkg.EnglishToInt.englishToInt'
[ function englishToIntenglishToInt (line:7): Syntax error on tokens, delete
these tokens
]/
... What tokens?? lol
Thanks,
Joe
--
View this message in context: http://drools.46999.n3.nabble.com/Trouble-with-the-MVEL-Map-syntax-tp3844...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month