         break
     @autoOrdering = null if bracketsClosed and @autoOrdering is true
 
+  done: ->
+    if @ordered or @autoOrdering
+      @processOutputQueue()
+    @load--
+    @emit 'deactivate', @load
+
 exports.Component = Component
 
 class ProcessInput


  shutdown: ->
    @started = false

  # The startup function performs initialization for the component.
  start: ->
    @started = true
    @started


  # Finishes process activation gracefully
  done: (error) ->
    @error error if error
    @result.__resolved = true
    @nodeInstance.done()
