the jpdl processdefinition can be extended by custom elements. You can e.g. add an attribute 'estimatedManHours' to a task element and retrieve the processdefinition runtime and get this parameter. You currently have to turn of validation on the server side for this as the processdefinitionparser is not namespace aware (yet I hope, as does Koen and Tom but not Gavin).
Hmm, yeah I guess that makes sense... for some reason I had it set in my mind that since all the task instances for a process instance weren't created from the get go, that I wasn't going to be able to plan ahead, but obviously the process definition itself could be accessed runtime!
Thanks for the reminder.
I'm going to propose to make the processdefinition parser namespace aware, so it can parse it's normal jpdl tags, but allows custom namespaces, so
<jpdl:task cust:estimatedManHours="10h"> ... </jpdl:task>
will be possible
Than, in the near future, Koen kan also add his gpd elements/attributes to it
<jpdl:task gpd:x="10" gpd:y="20" cust:estimatedManHours="10h"> ... </jpdl:task>
it seems like a common thing to want to be able to do... for now i have tried adding the attributes i need to Task and that seems to be working well.
great that it works, could you make a small wiki page describing how you exactely achieved this? We'd appreciate that very much.
Cool, thanks, I edited the page a little for readability.
Some small remarks: What you did now is extend the jbpm core in such a way that you have to manually change this each time a new jbpm core comes out.
It can be done in a non-intrusive way.
What you can do is just turn of validation on the server side when parsing processdefinitions (I don't know by hart how to do this) and runtime read the processdefinition from the database. It is a string then which can be converted to an xml document and custom attributes can be read. I'll try and find more on this tonight and add it to the wiki
Ok - you should be able to find a mini tutorial here now: http://wiki.jboss.org/wiki/Wiki.jsp?page=CustomTasks
(Linked from the jbpm home wiki page under jbpm 3)
Thanks for doing that, it looks like a good start.
I'm wondering if it makes sense to mention something about an associated change of the jpdl xsd (jpdl-3.2.xsd) file to support the new element?
Maybe not needed, but I'd like to point out that this is NOT default jbpm functionality (maybe not yet). So an xsd that supports this should be custom made as well.
What you did now is extend the jbpm core in such a way that you have to manually change this each time a new jbpm core comes out. [..] What you can do is [..] runtime read the processdefinition from the database. It is a string then which can be converted to an xml document and custom attributes can be read.
Or, alternatively, does anyone know if there's a way to define "MyTask extends org.jbpm.taskmgmt.def.Task", and then make jBPM use that custom class rather than the original?
an xsd that supports this should be custom made as well
To disable validation see 18.4.1. Validation:
When parsing a jPDL XML document, jBPM will validate your document against the jPDL schema when two conditions are met: first, the schema has to be referenced in the XML document like this
<process-definition xmlns="urn:jbpm.org:jpdl-3.2"> ... </process-definition>
And second, the xerces parser has to be on the classpath.
Thank you....... there is even more in the docs than I am aware of :-)