def complete(self, session, data): id = data['state']['id'] input = data['state'].get('input') or {} expected_outcome = input.get('outcome', 'completed') output = input.get('output') if output: output = {k: surrogate(v) for k, v in output.iteritems()} else: output = None if expected_outcome in ('completed', 'failed'): self.push(id, self.outcome(expected_outcome, output))
def complete(self, session, data): id = data['state']['id'] input = data['state'].get('input') or {} expected_outcome = input.get('outcome', 'completed') output = input.get('output') if output: output = {k: surrogate(v) for k,v in output.iteritems()} else: output = None if expected_outcome in ('completed', 'failed'): self.push(id, self.outcome(expected_outcome, output))