1

I have setup a content rule that gets triggered when I change the state of a dexterity object through the web interface, but when I change the state programmatically the content rule is not triggered.

I use the typical workflow_tool.doActionFor for changing the review_state. The review_state in the catalog/object appears changed to the new state.

Any clues??

I'm using plone 4.2.5 and dexterity 1.2.1.

This is the code I use to change the state:

cart = brains[0].getObject()
wftool = getToolByName(self.context, 'portal_workflow')
wftool.doActionFor(cart, 'charge')
wftool.doActionFor(cart, 'pay')
modified(cart)
4

1 回答 1

0

最后我发现一次只触发一个转换,plone 会按预期触发内容规则。

因此,就我而言,我通过以下方式设置了解决方法:

状态为:created -> charged -> paid,当更改为状态paid时,内容规则会触发。有时我必须在一笔交易中将状态从已创建更改为已付款。我启用了从创建状态绕过中间状态charged的​​支付转换。所以,我只需要触发一个转换来支付一个创建的对象,内容规则就起作用了。

于 2013-05-08T18:04:55.273 回答