Add basic ActivityTask model

This commit is contained in:
Jean-Baptiste Barth 2015-10-24 12:57:06 +02:00
commit fa4608be98
3 changed files with 45 additions and 0 deletions

View file

@ -13,6 +13,7 @@ from ..exceptions import (
SWFTypeDeprecatedFault,
SWFValidationException,
)
from .activity_task import ActivityTask
from .activity_type import ActivityType
from .decision_task import DecisionTask
from .domain import Domain

View file

@ -0,0 +1,20 @@
from __future__ import unicode_literals
import uuid
class ActivityTask(object):
def __init__(self, activity_id, activity_type, workflow_execution, input=None):
self.activity_id = activity_id
self.activity_type = activity_type
self.input = input
self.started_event_id = None
self.state = "SCHEDULED"
self.task_token = str(uuid.uuid4())
self.workflow_execution = workflow_execution
def start(self, started_event_id):
self.state = "STARTED"
self.started_event_id = started_event_id
def complete(self):
self.state = "COMPLETED"