def perform(&block)
      reset
      
      if valid?
        if use_event_attributes? && !block_given?
          each do |transition|
            transition.transient = true
            transition.machine.write(object, :event_transition, transition)
          end
          
          run_actions
        else
          within_transaction do
            catch(:halt) { run_callbacks(&block) }
            rollback unless success?
          end
        end
      end
      
      if actions.length == 1 && results.include?(actions.first)
        results[actions.first]
      else
        success?
      end
    end
def perform(&block)
      reset
      
      if valid?
        if use_event_attributes? && !block_given?
          each do |transition|
            transition.transient = true
            transition.machine.write(object, :event_transition, transition)
          end
          
          run_actions
        else
          within_transaction do
            catch(:halt) { run_callbacks(&block) }
            rollback unless success?
          end
        end
      end
      
      if actions.length == 1 && results.include?(actions.first)
        results[actions.first]
      else
        success?
      end
    end
Creates a new collection of transitions that can be run in parallel.  Each
 transition *must* be for a different attribute.

 Configuration options:
 * <tt>:actions</tt> - Whether to run the action configured for each transition
 * <tt>:after</tt> - Whether to run after callbacks
 * <tt>:transaction</tt> - Whether to wrap transitions within a transaction
 Runs each of the collection's transitions in parallel.

 All transitions will run through the following steps:
 1. Before callbacks
 2. Persist state
 3. Invoke action
 4. After callbacks (if configured)
 5. Rollback (if action is unsuccessful)

 If a block is passed to this method, that block will be called instead
 of invoking each transition's action.