Example #1
0
    def update(self):
        # we need a better way of binding multiple states and associated transitions, such
        # that we can chain them together.
        info = IWorkflowInfo(self.line_items[0])
        transitions = info.getManualTransitionIds()
        self.actions = bindTransitions(self, transitions, collection=True)

        return super(OrderContentsComponent, self).update()
    def update( self ):
        # we need a better way of binding multiple states and associated transitions, such
        # that we can chain them together.
        info = IWorkflowInfo( self.line_items[0] )
        transitions = info.getManualTransitionIds()
        self.actions = bindTransitions( self, transitions, collection=True )

        return super( OrderContentsComponent, self).update()
Example #3
0
    def __call__(self, form, action, data):
        context = getattr(form.context, '_object', form.context)

        if self.wf_name:
            info = component.getAdapter(context, IWorkflowInfo, self.wf_name)
        else:
            info = IWorkflowInfo(context)
        info.fireTransition(self.transition_id)
        form.setupActions()
    def __call__( self, form, action, data ):
        context = getattr( form.context, '_object', form.context )

        if self.wf_name:
            info = component.getAdapter( context, IWorkflowInfo, self.wf_name )
        else:
            info = IWorkflowInfo( context )
        info.fireTransition( self.transition_id )
        form.setupActions()
Example #5
0
    def __call__(self, form, action, data):
        nodes = form.getSelected(action, data)
        for n in nodes:
            IWorkflowInfo(n).fireTransition(self.transition_id)
            form.line_items.remove(n)

        # reset the form manager cache,
        # XXX we really need to broadcast a message to invalidate any states already stored
        form.__parent__.manager.items_by_state = None
Example #6
0
def AvailableGenericTransitions(context):
    return vocabulary.SimpleVocabulary.fromValues(
        IWorkflowInfo(context).getManualTransitionIds())