   execute: ->
     new Promise (resolve, reject) =>
       try
+        @barriers = {}
         @decisions = []
         @modifier = {}
         for event in @events
           if @[event.eventType]
-            @[event.eventType](event)
+            attributes = camelize(event.eventType, true) + "EventAttributes"
+            console.log attributes
+            input = JSON.parse event[attributes].input if event[attributes].input
+            @[event.eventType](event, event[attributes], input)
           else
             throw new errors.EventHandlerNotImplementedError
               message: "Event handler '#{event.eventType}' not implemented"

  DecisionTaskScheduled: (event) ->
  DecisionTaskStarted: (event) ->
  DecisionTaskCompleted: (event) ->
  ActivityTaskScheduled: (event) ->
  ActivityTaskStarted: (event) ->

module.exports = DecisionTask
_ = require "underscore"
camelize = require "underscore.string/camelize"
Promise = require "bluebird"
Match = require "mtr-match"
errors = require "../../helper/errors"
