> If you write a new XML body to adapted.body the settings of the workflow
> are changed. The body is not stored as a string, it is stored as object
> tree. (So yes, the workflow is 'initialized' with the settings defined
> in the XML file.) If you modify the object tree TTW reading adapted.body
> will return the XML representation of the modified settings. XML body
> and object tree are just two different ways to look at and modify the
> same settings.
Right. I cringe slightly when writing to a property has side-effects beyond
just storing a value (possibly with some checks or transformations, of
course). In this case, it seems it does a lot more (changing portal_workflow
for this implementation), in which case I think a method like update() would
be more clear.
I'm really just spelling that out to make sure I got it right, it's not that
big a deal - if it works, it works, and I'm happy. As I said, I'll probably
add a thin API around it for e.g. doing workflow imports and another for
doing FTI imports or whatnot.
View this message in context:
Sent from the Zope - CMF list2 forum at Nabble.com.
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests