OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] XRules: Mind your own business rules

[ Lists Home | Date Index | Thread Index ]

Greetings, you might XForms interesting [1], you will find that it allows both constraints and calculations to be associated with nodes in a document and uses XPath for the expressions. These associations are established with a <xf:bind> element and and calculations for a value are specified with a calculate attribute.

<xf:bind nodeset="/PurchaseOrder/Item">
 <xf:bind nodeset="ItemTotal" calculate="UnitPrice * Quantity" />

The part about creating an attribute will need a feature in XForms 1.1, but if the attribute was already present and simply required a value assigned, then this could also be done by adding:

  <xf:bind nodeset="@OverLimit" calculate="boolean(. &gt; ../MaxPerItem)" />

[1] http://www.w3.org/TR/xforms/

Regards, Roland

"Waleed Abdulla" <Waleed_Abdulla@xrules.org>

10/03/2005 10:16

[xml-dev] XRules: Mind your own business rules

Hi everyone,
   Thanks to XML and Web services, we're on the verge of an explosive
growth in the amounts of data that our software applications exchange with
each other. Some might argue that we're already drowning in it, but I think
we've only seen the tip of the iceberg.

   With that it becomes more important to be able to exchange business
rules between applications. So if I'm a service provider, I want to let my
user's software agent know what my business rules are so it can provide a
better experience to the user. For example, I want my user's software agent
to know that I charge $7 for ground shipping and $20 for overnight if the
order is under $50, and that ground shipping is free if the order is over
$50. And, I want the user's software to be able to dynamically calculate the
shipping cost locally as the user is editing the order. Basically, I want to
be able to give my business rules to someone else's software and have it
understand them (or, at least, behave as if it understands them).

   I've done a lot of work in this area and I'm looking to find out if
anyone is interested in participating in the ongoing design and development
of this effort. It involves two components:

1. XRules, which is an XML rules language that expresses constraints,
calculations, interdependencies, and properties that exist among nodes of an
XML document.
2. The Dynamic DOM, which is an extension of the DOM that dynamically
executes and validates XRules rules. For example, you change the ItemPrice
node and the ItemTotal node recalculates automatically.

   This is a fragment of a simple XRules document that shows how the total
price per item is calculated in a purchase order, and highlights (through
metadata properties) the items that exceed the allowed limit (a tutorial is
available at www.xrules.org):

<xr:ruleset context="/PurchaseOrder/Item">
 <xr:calculate target="ItemTotal" value="UnitPrice * Quantity" />
 <xr:bind target=".">
   <xr:property name="OverLimit" dvalue="boolean(. &gt; ../MaxPerItem)" />

And, this is a sample purchase order:


   You can also download examples and tools from http://www.xrules.org.

   So, if you're interested in the idea, or have suggestions or comments,
I'd like to hear it. And, if you think this is the worst thing since
chocolate bacon, then, well, I'd like to hear it too.

   And, what's the best way to propose something like this to W3C for their
consideration? Or does it have to be submitted by a W3C member?


The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://www.oasis-open.org/mlmanage/index.php>


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS