An updated KidAid tutorial with Maven integration

已查看 21 次
跳至第一个未读帖子

Tim Stephenson

未读,
2012年2月21日 21:42:592012/2/21
收件人 DTRules
I've prepared a Maven archetype based on the KidAid sample to create a
new project and a plugin to then run the compile and test for it. A
draft of a new Mavenized tutorial explains the intended usage:
https://docs.google.com/document/d/1yELxW3pnUyxuzsYR79EP9Yp5KUWYFHJQffZ7sYGjLdc/edit.

To actually try out the tutorial you need to patch your local DTRules
branch with this patch (https://docs.google.com/open?
id=0B_8neBOzPYRPYzBjNGNlNGYtMTdiNS00NDk2LTgzMWQtYzE3MzI3Nzc5NmQ5) and
run 'mvn install' to build the two new projects before following the
steps in the PDF. I'm afraid GIT is new to me so hopefully I've done
this right ...

This is just a proof of concept so please let me have your feedback.
Open questions that I have include:
1. Maven will report 'build successful' even if the DTRules compiler
or tester have failed. It would be good to have an exception or return
code to check.
2. DTRules outputs lots of useful information to the console. It
would be good if Maven could control the verbosity and destination of
this by injecting a logging class with the usual levels (DEBUG, INFO
etc.)
3. Maven is quite opinionated about generated artefacts being kept
under the target folder but at the moment I have not found a way to
push the DTRules test output there.
4. DTRules.xml has some conceptual overlap with pom.xml. Depending
on how far it is desired to go in the Maven direction we could look at
making DTRules.xml optional or even deprecated.

I hope you find this useful
Tim

paul snow

未读,
2012年2月22日 10:00:012012/2/22
收件人 dtr...@googlegroups.com
Some responses inline

On Tue, Feb 21, 2012 at 8:42 PM, Tim Stephenson <t...@pailz.com> wrote:
I've prepared a Maven archetype based on the KidAid sample to create a
new project and a plugin to then run the compile and test for it. A
draft of a new Mavenized tutorial explains the intended usage:
https://docs.google.com/document/d/1yELxW3pnUyxuzsYR79EP9Yp5KUWYFHJQffZ7sYGjLdc/edit.

To actually try out the tutorial you need to patch your local DTRules
branch with this patch (https://docs.google.com/open?
id=0B_8neBOzPYRPYzBjNGNlNGYtMTdiNS00NDk2LTgzMWQtYzE3MzI3Nzc5NmQ5) and
run 'mvn install' to build the two new projects before following the
steps in the PDF. I'm afraid GIT is new to me so hopefully I've done
this right ...

This is just a proof of concept so please let me have your feedback.
Open questions that I have include:
 1. Maven will report 'build successful' even if the DTRules compiler
or tester have failed. It would be good to have an exception or return
code to check.

This would be pretty easy to add.  Will look at it.
 
 2. DTRules outputs lots of useful information to the console. It
would be good if Maven could control the verbosity and destination of
this by injecting a logging class with the usual levels (DEBUG, INFO
etc.)

Integration with a logging class is also a pretty good idea.  Will look at that too.
 
 3. Maven is quite opinionated about generated artefacts being kept
under the target folder but at the moment I have not found a way to
push the DTRules test output there.

DTRules uses its config file to determine where to write this data.  So you can
change the DTRules.xml file to point to the target folder and output your data there.
 
 4. DTRules.xml has some conceptual overlap with pom.xml. Depending
on how far it is desired to go in the Maven direction we could look at
making DTRules.xml optional or even deprecated.

I am not sure about this.  The dtrules.xml file provides information about how to
build Rule Sets within a DTRules project.  That is very much like what a pom.xml
file does. However, it also defines how to deploy the Rule Sets.  I am not sure the
pom.xml file does that, but maybe it can?

Tim Stephenson

未读,
2012年2月22日 21:05:082012/2/22
收件人 DTRules
Couple of further thoughts from me on 2, 3 and 4 (below)

> > 2. DTRules outputs lots of useful information to the console. It
> > would be good if Maven could control the verbosity and destination of
> > this by injecting a logging class with the usual levels (DEBUG, INFO
> > etc.)
>
> Integration with a logging class is also a pretty good idea. Will look at
> that too.

To use a logging class Maven requires implementation of
org.apache.maven.plugin.logging.Log, which I can't imagine will be a
desirable dependency for dtrules-engine so I suggest you use whatever
you prefer (I'd suggest JDK logging or Log4J) and I'll wrap that
within the dtrules-maven-plugin.

> > 3. Maven is quite opinionated about generated artefacts being kept
> > under the target folder but at the moment I have not found a way to
> > push the DTRules test output there.
>
> DTRules uses its config file to determine where to write this data. So you
> can
> change the DTRules.xml file to point to the target folder and output your
> data there.

I had made some progress with this (see DTRules below) but did not
find a way to specifically move the testfiles/output/ folder?

<DTRules>

<RuleSet name="KidAid" source="file">
<RuleSetFilePath>/target/xml</RuleSetFilePath>
<WorkingDirectory>/target/dtrules-temp</WorkingDirectory>

<DTExcelFolder>/DecisionTables/</DTExcelFolder>
<EDDExcelFolder>/edd/</EDDExcelFolder>

<Entities name="kidaid_edd.xml" />
<Decisiontables name="kidaid_dt.xml" />
<Map name="kidaid_map.xml" />
</RuleSet>

</DTRules>


> > 4. DTRules.xml has some conceptual overlap with pom.xml. Depending
> > on how far it is desired to go in the Maven direction we could look at
> > making DTRules.xml optional or even deprecated.
>
> I am not sure about this. The dtrules.xml file provides information about
> how to
> build Rule Sets within a DTRules project. That is very much like what a
> pom.xml
> file does. However, it also defines how to deploy the Rule Sets. I am not
> sure the
> pom.xml file does that, but maybe it can?
>

Yes, I was less sure of this and had been forgetting the runtime
usage. Maybe there is a way but let's park it for now.

On Feb 23, 2:00 am, paul snow <snow.p...@gmail.com> wrote:
> Some responses inline
>
>
>
>
>
>
>
>
>
> On Tue, Feb 21, 2012 at 8:42 PM, Tim Stephenson <t...@pailz.com> wrote:
> > I've prepared a Maven archetype based on the KidAid sample to create a
> > new project and a plugin to then run the compile and test for it. A
> > draft of a new Mavenized tutorial explains the intended usage:
>
> >https://docs.google.com/document/d/1yELxW3pnUyxuzsYR79EP9Yp5KUWYFHJQf...
> > .
回复全部
回复作者
转发
0 个新帖子