@@ -169,17 +169,15 @@ def add_decision_task_timed_out(self,
169169 def add_activity_task_schedule_failed (self ,
170170 activity_id ,
171171 decision_id ,
172+ activity_type ,
172173 cause ):
173174 self .events .append (EventFactory ({
174175 u'eventId' : self .next_id ,
175176 u'eventTimestamp' : 1386947268.527 ,
176177 u'eventType' : u'ScheduleActivityTaskFailed' ,
177178 u'scheduleActivityTaskFailedEventAttributes' : {
178179 u'activityId' : activity_id ,
179- u'activityType' : {
180- u'name' : u'analysis.make_bad_link_counter_file' ,
181- u'version' : u'2.0'
182- },
180+ u'activityType' : activity_type .copy (),
183181 u'cause' : cause ,
184182 u'decisionTaskCompletedEventId' : decision_id ,
185183 }
@@ -302,6 +300,8 @@ def add_activity_task(self,
302300 result = None ,
303301 reason = DEFAULT_REASON ,
304302 details = DEFAULT_DETAILS ,
303+ activity_type = None ,
304+ cause = None ,
305305 timeout_type = 'START_TO_CLOSE' ):
306306 self .add_activity_task_scheduled (
307307 activity ,
@@ -312,6 +312,14 @@ def add_activity_task(self,
312312 if last_state == 'scheduled' :
313313 return self
314314
315+ if last_state == 'schedule_failed' :
316+ self .add_activity_task_schedule_failed (
317+ activity_id ,
318+ decision_id ,
319+ activity_type ,
320+ cause )
321+ return self
322+
315323 scheduled_id = self .last_id
316324 self .add_activity_task_started (scheduled = scheduled_id )
317325 if last_state == 'started' :
0 commit comments