[jboss-dev-forums] [Design of JBoss jBPM] - Re: dataflow integration
msandoz
do-not-reply at jboss.com
Wed Jun 27 15:12:37 EDT 2007
"koen.aers at jboss.com" wrote : To be honest, I did not see the post until now.
|
| As for the questions asked, I will document how to do this type of customization soon. It is not as easy as I want it to be yet. The best way to do it at the moment is indeed create a new mapping with a new semantic element that would derive from the generic node and a new xml mapping element that uses the 'node' xml tag. You can provide entries in the palette for it with the paletteEntry extension point and additional property editors that would appear in a new tab or in a tab of your choice by using the propertyTab and propertySection extension point.
|
| Let us know how it goes.
|
| Regards,
| Koen
I'm working on the extension points with limited success. The XmlAdapterFactory and SemanticElementFactory are where I've been concentrating my work and they seem to be heavily dependent on the xml node name - for creating new elements and reading elements in from the process definition file.
what i've done so far is:
| 1. added a SemanticElement "Jython Node", pointed it to a model class I copied from Node, gave it the name "jython-node" and id "org.jbpm.gd.jpdl.jythonNode". the model class was identical to Node other than where it explicitly cast something as a node, I changed it to cast to a JythonNode.
| 2. added a palette entry with object org.jbpm.gd.jpdl.jythonNode
| 3. added an xmlMappings mapping with id and semantic element "org.jbpm.gd.jpdl.jythonNode" and a JythonNodeDomAdapter adapter class and an xmlElement of "node"
| 4. added a notationMapping mapping id jythonNode with semantic element "org.jbpm.gd.jpdl.jythonNode" and notation element org.jbpm.gd.jpdl.node
|
|
| An alternative to having to change the node name in the xml for each of my nodes - which leads to lots of changes - is to have the mapping between semantic elements and dom adapters managed by a set of mapping classes operating like a chain of responsibility. these mapping classes would be able to determine, given a semantic element, if they were able to map it to a dom adapter or, given a dom adapter, they would be able to determine if they could map it to a particular type of semantic element. when generating one from the other, you could simply loop through the classes until one was able to do the mapping desired. you could then deal with any overlaps with precedence among the mappers.
|
| for example a mapper could take a chunk of xml and determine which semantic element should be generated by introspecting into it. it could then choose a dom adapter appropriate to that semantic element.
|
| in my case id like nodes to be different semantic elements based upon their handler class. if i couldnt identify what element to provide, id just fall back on Node.
|
| what do you think? is there an easier way to do this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058377#4058377
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058377
More information about the jboss-dev-forums
mailing list