Please advise regarding documentation of DSL w.r.t. IDE and BRMS
by Wolfgang Laun
While rewriting what is now section 5.10, Domain Specific Languages, I've
come across several references to DSL and DSLR editors in the IDE and BRMS.
Some of these paragraphs are misplaced, and/or rather incoherent, and things
might be missing: thus, they cannot remain as they are.
I can commit the revised section and expect s.o. else to write an empty
subsection referring to IDE & BRMS.
Or I can incorporate an improved writeup of whatever of IDE/BRMS should be
documented as a part of the "language definition" for DSL,
provided s.o. sends me this text.
Or I can refer readers to other parts of the documentation (which ones?)
where these topics are fully covered.
Or...?
Please advise.
Cheers
-W
13 years, 11 months
git branches origin/<username>
by Wolfgang Laun
I'm not sure what purpose the remote branches origin/<username> should
fulfill. Branch names should always be associated with some task. (E.g.,
origin/JBRULES-2858 for fixing that one.)
Continuing work, from time to time, on a long-lived branch is bound to be
tricky and probably confusing to other team members.
-W
13 years, 11 months
Drl to Xml conversion
by ADITYA CHITRE
Hi,
I am trying to convert a drl file to an xml file using drool xml language. In there a way to convert the drool fusion operators (temporal) from the drl file to an xml equivalent? For eg. the time information (3m30s, 4m) in the fusion temporal operator "before[ 3m30s, 4m ]" is being ignored when the xml conversion is done. Is it possible to preserve this time information using xml drool api's?
Regards,
Aditya
13 years, 11 months
Real World Examples Wanted!!!!!!
by Mark Proctor
We often get complaints about not enough real world examples in Drools.
We have a large community now, so surely a few of you must be able to
write up examples based on your work? So please, please, please, please
take the time to help us here.
Thanks
Mark
13 years, 11 months
Mythic Game Project Addition Artificial Intelligence and Quest System Components
by Mark Proctor
http://blog.athico.com/2011/01/mythic-game-project-addition-artificial.html
"In this project, we describe the design decisions and principles behind
the arti cial intelligence (AI) for a multiplayer online role playing
game, and our use of an expert system to implement it. We explain how we
organize AI rules into les, how those rules are assembled from a
database, how AI is assigned to entities, the di erent types of AI, the
di erent phases of AI, and how we manage facts used by AI. We also
review some of the history behind the Mythic project, where it is
headed, what an expert system is and why we chose to use one for our
project. The result of our project is a design that allows us to have
diverse AI behavior and exibility to reuse code to create new behaviors,
but may prove to be ineffcient if implemented on systems with many
players or many instances of AI running."
13 years, 11 months
Drools Content Based Routing with Camel (John Ellis)
by Mark Proctor
http://blog.athico.com/2011/01/drools-content-based-routing-with-camel.html
Drools Content Based Routing with Camel (John Ellis)
<http://blog.athico.com/2011/01/drools-content-based-routing-with-camel.html>
John Ellis has done a nice writeup of his work on improving Drools to
work with Camel for CBR. You'll need to use the latest version of Drools
from trunk, which can be found in the maven repository that's
5.2.0-SNAPSHOT,
https://repository.jboss.org/nexus/content/groups/public/org/drools/.
For bonus points I'd love to see a further Drools and Camel tutorial
around OSGi's EventAdmin, http://camel.apache.org/eventadmin.html <http://>.
One of Camel's greatest strengths is the explicit support for Enterprise
Integration Patterns <http://www.eaipatterns.com/toc.html>. Drools
itself is particularly well suited to work alongside Camel to implement
two commonly used integration patterns: the Content Based Router and the
Dynamic Router. Both patterns leverage the ability of a Drools Endpoint
to rapidly evaluate properties of a message, while the Dynamic Router
can also integrate the Drools Policy as a dynamic rule based on feedback
from a control channel.
The Camel routes required for message routing do not differ much from
the previous Drools Endpoint example. You may even be able to omit the
Drools Policy if you wish to inspect only the headers of messages being
routed instead of interrogating the body of each message. For example, a
DRL could be defined that takes action on inbound messages such as:
import org.apache.camel.Message;
rule "WriteOperations"
when
$message : Message(headers["OPERATION"] == "WRITE");
then
$message.setHeader("routingSlip", "activemq:queue:op.write");
end
rule "ReadOperations"
when
$message : Message(headers["OPERATION"] == "READ");
then
$message.setHeader("routingSlip", "activemq:queue:op.read");
end
Example 1: DRL for Routing Based on Message Headers
Here the custom header "OPERATION" is evaluated to see if it is set to
the value "WRITE" or "READ." Depending on the value of this header, a
routing slip is defined for the message. The Routing Slip is another
Enterprise Integration Pattern supported by Camel that may contain one
or more URIs. The message is then sequentially sent to each URI defined.
The Camel routing itself is simply defined as:
<route>
<from uri="activemq:queue:router"/>
<to uri="drools:brokerNode/cbrKSession?action=insertMessage"/>
<routingSlip uriDelimiter="#">
<header>routingSlip</header>
</routingSlip>
</route>
Example 2: Camel Routes for Content Based Routing
Here we explicitly inform Camel that routing slips are defined as values
within the "routingSlip" header and each URI is delimited by a #
character. The headers set within the DRL are then interpreted as each
message exits the Drools endpoint.
Content based routing with a Drools Endpoint offers several advantages
over Camel's default implementation. The DRL format itself allows
routing to be specified more succinctly than Sprint DSLs or Camel
RouteBuilders. Conditional operations are also evaluated more
efficiently within Drools and are thread-safe, allowing a high volume of
messages to be routed concurrently.
13 years, 11 months
How to set workingset on a guided rule in guvnor
by Nicolas Héron
Hello,
I am trying to use working set with guvnor but I cannot see the "working
set" button on the guided rule editor on guvnor ?
is there a new way of setting working set for a rule ? or is it a small bug
?
Thanks
Nicolas
13 years, 12 months
2nd call: Summary of all new features in DSL - comments, please
by Wolfgang Laun
Probably sent not at the best of times, this didn't get a peep from anyone.
Please do comment, for the reasons stated below.
-W
On 24 December 2010 11:23, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
> This is a summary of the currently implemented new features for the DSL
> expansion. I'll have to add tests and documentation, but before doing so,
> I'd like to learn whether there are any objections (resulting in the
> removal) or suggestions for improvement. Myself, I'm not sure about one or
> two items which I've marked with "(?)". Also, there's a couple of items
> which might gain from easy-to-implement additions, see "Votes, please". An
> example showing most of the new options is given below.
>
> 1. The right hand side of entry definitions can be empty. (Useful for
> deleting "filler" phrases.)
> 2. Long entry lines can be split without the need of escaping EOL:
> - Any line beginning with # or // starts a DSL comment and is not
> passed to the DSL parser.
> - Any line beginning with '[' starts a new entry.
> - All other lines are appended to the preceding line, with a space
> replacing EOL.
> - Empty lines are inserted to maintain original line numbers, and
> line and column numbers in error messages from the parser are recalculated
> to reflect the user view of the DSL text.
> 3. The special comment introduction "#/" is used to mark a line
> containing debug options. Currently recognized keywords are:
> - result - dumps the resulting DRL
> - steps - shows all expansion operations in conditions and
> consequences
> - keyword, when, then - display the corresponding entry definitions
> - usage - shows how often an entry was actually used in an expansion
> 4. Variable substitution uses the definition of that variable seen last
> in the current when or then part expansion. not just from the current line.
> (But this probably should keep variables from the when part for the
> following then part. Votes, please.)
> 5. The value used in a variable substitution can be modified on the fly
> by adding one of the modifiers after and '!' in the variable reference.
> Currently recognized modifiers are:
> - uc, lc - convert all letters to upper case or lower case,
> respectively
> - ucfirst - convert the first letter to upper case, and all other
> letters to lower case
> - num - extract all digits and a '-' preceding the first digit and
> insert the numeric value; a '.' or ',' two digits from the right is retained
> as a decimal point, which is useful for monetary quantitites. (?)
> 6. Another modification of the value used for substituting the
> reference is by providing a "multiple choice" after an '!', consisting of
> strings separated alternatively by '?' and '/': If the string extracted from
> the DSLR line matches the string before a '?', the string following it is
> used for substitution; otherwise test the next choice. (?)
> 7. A DSL value starting with a hyphen ('-') can also be used in a
> consequence to add another setter expression into a preceding "modify(x){}".
> (Should probably be extended to be able to handle the insertion of another
> parameter to any preceding method call and, as a special, but useful, case
> the concatenation to a preceding x.println() or x.print() call. Votes,
> please.)
>
> DSL:
> [when][][Tt]here is an?=
> [when][]{entity} called {x}=
> ${entity!lc}: {entity!ucfirst}( $name:
> name=="{x!M?Mark/E?Edson/G?Geoffrey/unknown}")
> [when][]and no other with the same {attr}=not {entity!ucfirst}( {attr} ==
> ${attr} )
> [then][]change person=modify($person)\{\}
> [then][]- set {attr} to {value} = set{attr!ucfirst}( {value!num} )
>
> DSLR:
> rule "Rule 1"
> when
> There is a PERSON called M
> and no other with the same name
> then
> change person
> - set salary to US$9,999.99
> - set rank to "colonel"
> end
>
> DRL:
> 8 rule "Rule 1"
> 9 when
> 10 $person: Person( $name: name=="Mark")
> 11 not Person( name == $name )
> 12 then
> 13 modify($person){ setSalary( 9999.99 ), setRank( "colonel" ) }
> 14 end
>
> Cheers
> Wolfgang
>
>
>
13 years, 12 months
Import of declared type in other drools resources
by stanka
Hi,
I'm using eclipse drools builder to develop my rules, and when I define one
drools declared type in one resource and use it in a different drools
resource, the declared type is not resolved. Even if the resources are in
the same package.
Also, when I include the files in the correct order in the knowledgeBase,
everything starts working in my application.
1)Is there a way to make my eclipse drools builder find the declared type in
the other resources? It shows the following error: Unable to resolve
ObjectType
2)Is there a way to make the files work in any order? Now, my application
works only if the declared types are with resource name alphabetically
preceeding the name of the resource where the types are used.
Please tell me if you need additional information.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Import-of-declared-ty...
Sent from the Drools - Dev mailing list archive at Nabble.com.
13 years, 12 months