New feature: external attributes

2 views
Skip to first unread message

Paul Lorenz

unread,
Jul 11, 2009, 12:10:02 PM7/11/09
to sarasvat...@googlegroups.com
I created a feature branch for external attributes. The work is pretty
much finished now and I thought I give a couple days for review, it
anyone wants to take a look. I'll probably merge it in on Monday or
Tuesday, if I don't hear anything negative.

http://code.google.com/p/sarasvati/source/detail?r=924

It allows defining custom attributes for each instance of an external imported.

So one could do something like:

<?xml version="1.0"?>

<process-definition name="external-env-two"
xmlns="http://sarasvati.googlecode.com/ProcessDefinition">

<node name="B">
<arc external="one" to="A"/>
<arc external="two" to="A"/>
</node>

<external name="one" processDefinition="external-env-one">
<custom>
<foo>bar</foo>
<hello>world</hello>
</custom>
</external>

<external name="two" processDefinition="external-env-one">
<custom>
<foo>baz</foo>
<hello>universe</hello>
</custom>
</external>

</process-definition>

Here's some new documentation for Node that should make how nesting works clear:

* <process-definition name="Graph I">
* <node name="A"/>
* </process-definition>
*
* <process-definition name="Graph II">
* <external name="G1" processDefinition="Graph I">
* <custom>
* <foo>bar</foo>
* <hello>world</hello>
* </custom>
* </external>
*
* <node name="B">
* <arc external="G1" to="A"/>
* </node>
* </process-definition>
*
* <process-definition name="Graph III">
* <external name="G2" processDefinition="Graph II">
* <custom>
* <foo>baz</foo>
* </custom>
* </external>
*
* <node name="C">
* <arc external="G2" to="B"/>
* </node>
* </process-definition>
*
* If you get node A from graph III, you can observe the following:
*
* Node nodeA = ...;
* nodeA.getExternalEnv().getAttribute( "foo" ) // returns "baz"
* nodeA.getExternalEnv().getAttribute( "hello" ) // returns "world"
* nodeA.getExternal().getEnv().getAttribute( "foo" ) // returns "baz"
* nodeA.getExternal().getEnv().getAttribute( "hello" ) // returns null
* nodeA.getOriginatingExternalNode().getExternal().getEnv().getAttribute(
"foo" ) // returns "bar"
* nodeA.getOriginatingExternalNode().getExternal().getEnv().getAttribute(
"hello" ) // returns "world"


cheers,
Paul

Cheong Chung Onn

unread,
Jul 12, 2009, 12:45:19 AM7/12/09
to sarasvat...@googlegroups.com
Hi Paul,

I have yet use the external PD feature and I wont be comment on it :)
Reply all
Reply to author
Forward
0 new messages