Returns changes between current model instance, and remote object representation
Returns: | A list of swf.models.base.ModelDiff namedtuple describing differences |
---|---|
Return type: | list |
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Deprecates the workflow type amazon-side
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Checks if current Model instance has changes, comparing with remote object representation
Return type: | bool |
---|
descr.__get__(obj[, type]) -> value
Creates the workflow type amazon side
Starts a Workflow execution of current workflow type
Parameters: |
|
---|
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Returns changes between current model instance, and remote object representation
Returns: | A list of swf.models.base.ModelDiff namedtuple describing differences |
---|---|
Return type: | list |
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Deprecates the connected swf object amazon side
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Returns workflow execution history report
Returns: | The workflow execution complete events history |
---|---|
Return type: | swf.models.event.History |
descr.__get__(obj[, type]) -> value
Checks if current Model instance has changes, comparing with remote object representation
Return type: | bool |
---|
descr.__get__(obj[, type]) -> value
Creates the connected swf object amazon side
Records a signal event in the workflow execution history and creates a decision task.
The signal event is recorded with the specified user defined signal_name and input (if provided).
Parameters: |
|
---|
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Instantiates a new upstream version of the model
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Simple workflow execution event wrapper base class
Intends to be used as a base abstraction for the multiple amazon swf events implementation. Generally events implementation will be instantiated through the swf.models.event.factory.EventFactory factory.
It provides basic common attributes, such as the event type, name, json representation key to extract relevant data from, and sets the event id, state and timestamp from the constructor.
Event base class is used in this project to implement swf.models.event.task.DecisionTaskEvent, which a typical instance would for example have type ‘DecisionTask’, name ‘DecisionTaskScheduleFailed’, id ‘1’ and state ‘failed’.
Parameters: |
|
---|
Processes the event raw_data attributes_key elements and sets current instance attributes accordingly
Returns changes between current model instance, and remote object representation
Returns: | A list of swf.models.base.ModelDiff namedtuple describing differences |
---|---|
Return type: | list |
descr.__get__(obj[, type]) -> value
Deprecates the domain amazon side
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Checks if current Model instance has changes, comparing with remote object representation
Return type: | bool |
---|
descr.__get__(obj[, type]) -> value
Creates the activity type amazon side
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Returns changes between current model instance, and remote object representation
Returns: | A list of swf.models.base.ModelDiff namedtuple describing differences |
---|---|
Return type: | list |
Deprecates the connected swf object amazon side
descr.__get__(obj[, type]) -> value
Checks if the connected swf object exists amazon-side
descr.__get__(obj[, type]) -> value
Checks if current Model instance has changes, comparing with remote object representation
Return type: | bool |
---|
Creates the connected swf object amazon side
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
descr.__get__(obj[, type]) -> value
Instantiates a new upstream version of the model
descr.__get__(obj[, type]) -> value
Swf domain queryset object
Allows the user to interact with amazon’s swf domains through a django-queryset like interface
Retrieves every domains
Parameters: | registration_status (string) – domain registration status to match, Valid values are: * swf.constants.REGISTERED * swf.constants.DEPRECATED |
---|
A typical Amazon response looks like:
{
"domainInfos": [
{
"name": "Crawl"
"status": "REGISTERED",
"description": "",
},
]
}
Creates a new remote domain and returns the Domain model instance
Parameters: |
|
---|
Fetches the Domain with name
Parameters: | name (string) – name of the domain to fetch |
---|
A typical Amazon response looks like:
{
"configuration": {
"workflowExecutionRetentionPeriodInDays": "7",
},
"domainInfo": {
"status": "REGISTERED",
"name": "CrawlTest",
}
}
Fetches, or creates the Domain with name
When fetching trying to fetch a matching domain, only name parameter is taken in account. Anyway, If you’d wanna make sure that in case the domain has to be created it is made with specific values, just provide it.
Parameters: |
|
---|---|
Returns: | Fetched or created Domain model object |
Return type: | Domain |
Retrieves every Workflow types
Parameters: | registration_status (string) – workflow type registration status to match, Valid values are: * swf.constants.REGISTERED * swf.constants.DEPRECATED |
---|
A typical Amazon response looks like:
{
"typeInfos": [
{
"status": "REGISTERED",
"creationDate": 1364293450.67,
"description": "",
"workflowType": {
"version": "1",
"name": "Crawl"
}
},
{
"status": "REGISTERED",
"creationDate": 1364492094.968,
"workflowType": {
"version": "1",
"name": "testW"
}
}
]
}
Creates a new remote workflow type and returns the created WorkflowType model instance.
Parameters: |
|
---|
Filters workflows based on the domain they belong to, their status, and/or their name
Parameters: |
|
---|---|
Returns: | list of matched WorkflowType models objects |
Return type: | list |
Fetches the Workflow Type with name and version
Parameters: |
|
---|---|
Returns: | matched workflow type instance |
Return type: | swf.core.model.workflow.WorkflowType |
A typical Amazon response looks like:
{
"configuration": {
"defaultExecutionStartToCloseTimeout": "300",
"defaultTaskStartToCloseTimeout": "300",
"defaultTaskList": {
"name": "None"
},
"defaultChildPolicy": "TERMINATE"
},
"typeInfo": {
"status": "REGISTERED",
"creationDate": 1364492094.968,
"workflowType": {
"version": "1",
"name": "testW"
}
}
}
Fetches, or creates the ActivityType with name and version
When fetching trying to fetch a matching workflow type, only name and version parameters are taken in account. Anyway, If you’d wanna make sure that in case the workflow type has to be created it is made with specific values, just provide it.
Parameters: |
|
---|---|
Returns: | Fetched or created WorkflowType model object |
Return type: | WorkflowType |
Fetches Workflow executions
Fetch every workflow executions during the last start_oldest_date days, with status
Parameters: |
|
---|---|
Returns: | workflow executions objects list |
Return type: | list |
A typical amazon response looks like:
{
"executionInfos": [
{
"cancelRequested": "boolean",
"closeStatus": "string",
"closeTimestamp": "number",
"execution": {
"runId": "string",
"workflowId": "string"
},
"executionStatus": "string",
"parent": {
"runId": "string",
"workflowId": "string"
},
"startTimestamp": "number",
"tagList": [
"string"
],
"workflowType": {
"name": "string",
"version": "string"
}
}
],
"nextPageToken": "string"
}
Filters workflow executions based on kwargs provided criteras
Parameters: |
|
---|
Be aware that querying over status allows the usage of statuses specific kwargs
STATUS_OPEN
param start_latest_date: latest start or close date and time to return (in days) type start_latest_date: int
STATUS_CLOSED
param start_latest_date: workflow executions that meet the start time criteria of the filter are kept (in days) type start_latest_date: int param start_oldest_date: workflow executions that meet the start time criteria of the filter are kept (in days) type start_oldest_date: int param close_latest_date: workflow executions that meet the close time criteria of the filter are kept (in days) type close_latest_date: int param close_oldest_date: workflow executions that meet the close time criteria of the filter are kept (in days) type close_oldest_date: int param close_status: must match the close status of an execution for it to meet the criteria of this filter. Valid values are: * CLOSE_STATUS_COMPLETED * CLOSE_STATUS_FAILED * CLOSE_STATUS_CANCELED * CLOSE_STATUS_TERMINATED * CLOSE_STATUS_CONTINUED_AS_NEW * CLOSE_TIMED_OUT type close_status: string returns: workflow executions objects list rtype: list
Swf activity type queryset object
Allows the user to interact with amazon’s swf activity types through a django-queryset-like interface
Parameters: | domain (swf.models.domain.Domain) – domain the activity type belongs to |
---|
Retrieves every activity types
Parameters: | registration_status (string) – activity type registration status to match, Valid values are: * swf.constants.REGISTERED * swf.constants.DEPRECATED |
---|---|
Returns: | list of matched ActivityType models objects |
Return type: | list |
A typical Amazon response looks like:
{
"nextPageToken": "string",
"typeInfos": [
{
"activityType": {
"name": "string",
"version": "string"
},
"creationDate": "number",
"deprecationDate": "number",
"description": "string",
"status": "string"
}
]
}
Creates a new remote activity type and returns the created ActivityType model instance.
Parameters: |
|
---|
Filters activity types based on their status, and/or name
Parameters: |
|
---|---|
Returns: | list of matched ActivityType models objects |
Return type: | list |
Fetches the activity type with provided name and version
Parameters: |
|
---|---|
Returns: | Matched activity type instance |
Return type: | swf.models.activity.ActivityType |
A typical Amazon response looks like:
{
"configuration": {
"defaultTaskHeartbeatTimeout": "string",
"defaultTaskList": {
"name": "string"
},
"defaultTaskScheduleToCloseTimeout": "string",
"defaultTaskScheduleToStartTimeout": "string",
"defaultTaskStartToCloseTimeout": "string"
},
"typeInfo": {
"activityType": {
"name": "string",
"version": "string"
},
"creationDate": "number",
"deprecationDate": "number",
"description": "string",
"status": "string"
}
}
Fetches, or creates the ActivityType with name and version
When fetching trying to fetch a matching activity type, only name and version parameters are taken in account. Anyway, If you’d wanna make sure that in case the activity type has to be created it is made with specific values, just provide it.
Parameters: |
|
---|---|
Returns: | Fetched or created ActivityType model object |
Return type: | ActivityType |
SWF Actor base class
Actor is running through a thread in order for it’s polling operations not to be blocking. Many actors might be ran through the same process.
Usage example: implementing an activity worker or a decider using an actor is the typical usage
Parameters: |
|
---|
Launches the actor
Any class overriding actor’s class should set this method to update actor’s status to Actor.STATES.RUNNING
Stops the actor
Sets actor’s status to Actor.STATES.STOPPED, and waits for the last polling operation to end before shutting down.
Activity task worker actor implementation
Once started, will start polling for activity task, to process, and emitting heartbeat until it’s stopped or crashes for some reason.
Parameters: |
|
---|
Responds to swf that the activity task was canceled
Parameters: |
|
---|
Responds to ``swf` that the activity task is completed
Parameters: |
|
---|
Replies to swf that the activity task failed
Parameters: |
|
---|
Records activity task heartbeat
Parameters: |
|
---|
Polls for an activity task to process from current actor’s instance defined task_list
if no activity task was polled, raises a PollTimeout exception.
Parameters: | task_list (string) – task list the Actor should watch for tasks on |
---|---|
Raises : | PollTimeout |
Returns: | polled activity task |
Type : | swf.models.ActivityTask |
Launches the actor
Any class overriding actor’s class should set this method to update actor’s status to Actor.STATES.RUNNING
Stops the actor
Sets actor’s status to Actor.STATES.STOPPED, and waits for the last polling operation to end before shutting down.