def mark(self, name, details=None): """Adds a RecordMarker decision. """ dec, attrs = decisions.skeleton("RecordMarker") attrs['markerName'] = name if details: attrs['details'] = details self._decisions.append(dec) return self
def complete(self, result, context=None): """Complete workflow execution. This can only be called from a decision task. """ dec, attrs = decisions.skeleton("CompleteWorkflowExecution") attrs['result'] = serializing.dumps(result) self._caller._decisions.append(dec) self._caller.complete(context=context)
def start_child(cls, input, control=None): """Start child workflow execution. ``input`` is serialized and a workflow id is generated from it using ``get_id_from_input``. """ dec, attrs = decisions.skeleton("StartChildWorkflowExecution") attrs.update(cls._get_static_child_start_attrs()) attrs['workflowId'] = cls.get_id_from_input(input) attrs['input'] = serializing.dumps(input) if control is not None: attrs['control'] = serializing.dumps(control) return dec
def schedule(cls, input, control=None): "Called from subclasses' ``schedule`` class method. " dec, attrs = decisions.skeleton("ScheduleActivityTask") attrs['activityId'] = cls.get_id_from_input(input) attrs['activityType'] = { 'name': cls.name, 'version': cls.version} attrs['taskList'] = {'name': cls.task_list} attrs['input'] = serializing.dumps(input) attrs['heartbeatTimeout'] = cls.heartbeat_timeout attrs['scheduleToCloseTimeout'] = cls.schedule_to_close_timeout attrs['scheduleToStartTimeout'] = cls.schedule_to_start_timeout attrs['startToCloseTimeout'] = cls.start_to_close_timeout if control is not None: attrs['control'] = serializing.dumps(control) return dec