@@ -169,17 +169,15 @@ def add_decision_task_timed_out(self,
169
169
def add_activity_task_schedule_failed (self ,
170
170
activity_id ,
171
171
decision_id ,
172
+ activity_type ,
172
173
cause ):
173
174
self .events .append (EventFactory ({
174
175
u'eventId' : self .next_id ,
175
176
u'eventTimestamp' : 1386947268.527 ,
176
177
u'eventType' : u'ScheduleActivityTaskFailed' ,
177
178
u'scheduleActivityTaskFailedEventAttributes' : {
178
179
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 (),
183
181
u'cause' : cause ,
184
182
u'decisionTaskCompletedEventId' : decision_id ,
185
183
}
@@ -302,6 +300,8 @@ def add_activity_task(self,
302
300
result = None ,
303
301
reason = DEFAULT_REASON ,
304
302
details = DEFAULT_DETAILS ,
303
+ activity_type = None ,
304
+ cause = None ,
305
305
timeout_type = 'START_TO_CLOSE' ):
306
306
self .add_activity_task_scheduled (
307
307
activity ,
@@ -312,6 +312,14 @@ def add_activity_task(self,
312
312
if last_state == 'scheduled' :
313
313
return self
314
314
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
+
315
323
scheduled_id = self .last_id
316
324
self .add_activity_task_started (scheduled = scheduled_id )
317
325
if last_state == 'started' :
0 commit comments