Tasks Component
Used to sync tasks from a source instance to a destination instance of Swimlane
sync_task
This method syncs a single task from a source Swimlane instance to a destination instance.
Using the provided task dictionary from Swimlane source instance we first get the actual task object from the source.
Next we also attempt to retrieve the task from the destination system.
If the task does not exist on the destination then we add it.
If it does exist, we check if the uid
and the version
are the same.
If they are the same we skip updating the task.
If they are different then we update the task on the destination instance.
Args: task (dict): A Swimlane task object from a source system.
Returns: dict: If we failed to add a task we return it so we can try again - only if called using the sync method.
def sync_task(self, task)
sync
This method is used to sync all tasks from a source instance to a destination instance
def sync(self)
Task Model
Action
__attrs_init__(self, type, descriptor, readonly, script=None, packageDescriptorId=None, assetId=None, forkedFromPackage=None, assetDependencyType=None, assetDependencyVersion=None, headers={}, parameters={}, authenticationParameters={}, requestType=None, apiType=None, authenticationType=None)
special
Method generated by attrs for class Action.
Source code in aqueduct/models/task.py
def __attrs_init__(self, type, descriptor, readonly, script=attr_dict['script'].default, packageDescriptorId=attr_dict['packageDescriptorId'].default, assetId=attr_dict['assetId'].default, forkedFromPackage=attr_dict['forkedFromPackage'].default, assetDependencyType=attr_dict['assetDependencyType'].default, assetDependencyVersion=attr_dict['assetDependencyVersion'].default, headers=attr_dict['headers'].default, parameters=attr_dict['parameters'].default, authenticationParameters=attr_dict['authenticationParameters'].default, requestType=attr_dict['requestType'].default, apiType=attr_dict['apiType'].default, authenticationType=attr_dict['authenticationType'].default):
self.type = type
self.descriptor = descriptor
self.readonly = readonly
self.script = script
self.packageDescriptorId = packageDescriptorId
self.assetId = assetId
self.forkedFromPackage = forkedFromPackage
self.assetDependencyType = assetDependencyType
self.assetDependencyVersion = assetDependencyVersion
self.headers = headers
self.parameters = parameters
self.authenticationParameters = authenticationParameters
self.requestType = requestType
self.apiType = apiType
self.authenticationType = authenticationType
self.__attrs_post_init__()
InputMapping (InputOutputFieldMapping)
__attrs_init__(self, addMissing, unixEpochUnit, enableDeletionOnNull, dataFormat, listModificationType, key=NOTHING, userFormat=None, subValue=None, example=None, type=None, value=None)
special
Method generated by attrs for class InputMapping.
Source code in aqueduct/models/task.py
def __attrs_init__(self, addMissing, unixEpochUnit, enableDeletionOnNull, dataFormat, listModificationType, key=NOTHING, userFormat=attr_dict['userFormat'].default, subValue=attr_dict['subValue'].default, example=attr_dict['example'].default, type=attr_dict['type'].default, value=attr_dict['value'].default):
self.addMissing = addMissing
self.unixEpochUnit = unixEpochUnit
self.enableDeletionOnNull = enableDeletionOnNull
self.dataFormat = dataFormat
self.listModificationType = listModificationType
if key is not NOTHING:
self.key = key
else:
self.key = __attr_factory_key()
self.userFormat = userFormat
self.subValue = subValue
self.example = example
self.type = type
self.value = value
InputOutputFieldMapping
__attrs_init__(self, addMissing, unixEpochUnit, enableDeletionOnNull, dataFormat, listModificationType, key=NOTHING, userFormat=None, subValue=None)
special
Method generated by attrs for class InputOutputFieldMapping.
Source code in aqueduct/models/task.py
def __attrs_init__(self, addMissing, unixEpochUnit, enableDeletionOnNull, dataFormat, listModificationType, key=NOTHING, userFormat=attr_dict['userFormat'].default, subValue=attr_dict['subValue'].default):
self.addMissing = addMissing
self.unixEpochUnit = unixEpochUnit
self.enableDeletionOnNull = enableDeletionOnNull
self.dataFormat = dataFormat
self.listModificationType = listModificationType
if key is not NOTHING:
self.key = key
else:
self.key = __attr_factory_key()
self.userFormat = userFormat
self.subValue = subValue
Output
__attrs_init__(self, type, mappings=[], createType=None, errorHandlingType=None, keyFieldId=None, applicationId=None, backReferenceFieldId=None, customDataFormat=None)
special
Method generated by attrs for class Output.
Source code in aqueduct/models/task.py
def __attrs_init__(self, type, mappings=attr_dict['mappings'].default, createType=attr_dict['createType'].default, errorHandlingType=attr_dict['errorHandlingType'].default, keyFieldId=attr_dict['keyFieldId'].default, applicationId=attr_dict['applicationId'].default, backReferenceFieldId=attr_dict['backReferenceFieldId'].default, customDataFormat=attr_dict['customDataFormat'].default):
self.type = type
self.mappings = mappings
self.createType = createType
self.errorHandlingType = errorHandlingType
self.keyFieldId = keyFieldId
self.applicationId = applicationId
self.backReferenceFieldId = backReferenceFieldId
self.customDataFormat = customDataFormat
self.__attrs_post_init__()
OutputMapping (InputOutputFieldMapping)
__attrs_init__(self, addMissing, unixEpochUnit, enableDeletionOnNull, dataFormat, listModificationType, key=NOTHING, userFormat=None, subValue=None, type=None, value=None, example=None, parserType=None, expression=None, customDataFormat=None)
special
Method generated by attrs for class OutputMapping.
Source code in aqueduct/models/task.py
def __attrs_init__(self, addMissing, unixEpochUnit, enableDeletionOnNull, dataFormat, listModificationType, key=NOTHING, userFormat=attr_dict['userFormat'].default, subValue=attr_dict['subValue'].default, type=attr_dict['type'].default, value=attr_dict['value'].default, example=attr_dict['example'].default, parserType=attr_dict['parserType'].default, expression=attr_dict['expression'].default, customDataFormat=attr_dict['customDataFormat'].default):
self.addMissing = addMissing
self.unixEpochUnit = unixEpochUnit
self.enableDeletionOnNull = enableDeletionOnNull
self.dataFormat = dataFormat
self.listModificationType = listModificationType
if key is not NOTHING:
self.key = key
else:
self.key = __attr_factory_key()
self.userFormat = userFormat
self.subValue = subValue
self.type = type
self.value = value
self.example = example
self.parserType = parserType
self.expression = expression
self.customDataFormat = customDataFormat
Task
__attrs_init__(self, action, isSystemTask, createdDate, modifiedDate, valid, uid, version, id, name, disabled, applicationId=None, description=None, createdByUser={}, modifiedByUser={}, inputMapping=[], outputs=[], triggers=[], actionType=None, actionDescription=None, actionDescriptorImageId=None, actionDescriptorName=None, actionDescriptorVendor=None, actionDescriptorProduct=None, actionDescriptorVersion=None, customDataFormat=None)
special
Method generated by attrs for class Task.
Source code in aqueduct/models/task.py
def __attrs_init__(self, action, isSystemTask, createdDate, modifiedDate, valid, uid, version, id, name, disabled, applicationId=attr_dict['applicationId'].default, description=attr_dict['description'].default, createdByUser=attr_dict['createdByUser'].default, modifiedByUser=attr_dict['modifiedByUser'].default, inputMapping=attr_dict['inputMapping'].default, outputs=attr_dict['outputs'].default, triggers=attr_dict['triggers'].default, actionType=attr_dict['actionType'].default, actionDescription=attr_dict['actionDescription'].default, actionDescriptorImageId=attr_dict['actionDescriptorImageId'].default, actionDescriptorName=attr_dict['actionDescriptorName'].default, actionDescriptorVendor=attr_dict['actionDescriptorVendor'].default, actionDescriptorProduct=attr_dict['actionDescriptorProduct'].default, actionDescriptorVersion=attr_dict['actionDescriptorVersion'].default, customDataFormat=attr_dict['customDataFormat'].default):
self.action = action
self.isSystemTask = isSystemTask
self.createdDate = createdDate
self.modifiedDate = modifiedDate
self.valid = valid
self.uid = uid
self.version = version
self.id = id
self.name = name
self.disabled = disabled
self.applicationId = applicationId
self.description = description
self.createdByUser = createdByUser
self.modifiedByUser = modifiedByUser
self.inputMapping = inputMapping
self.outputs = outputs
self.triggers = triggers
self.actionType = actionType
self.actionDescription = actionDescription
self.actionDescriptorImageId = actionDescriptorImageId
self.actionDescriptorName = actionDescriptorName
self.actionDescriptorVendor = actionDescriptorVendor
self.actionDescriptorProduct = actionDescriptorProduct
self.actionDescriptorVersion = actionDescriptorVersion
self.customDataFormat = customDataFormat
self.__attrs_post_init__()
TaskLight
__attrs_init__(self, id, name, disabled, actionType, actionDescription, actionDescriptorImageId, actionDescriptorName, valid, migrated=None, deprecated=None, applicationId=None, actionDescriptorVendor=None, actionDescriptorProduct=None, actionDescriptorVersion=None, description=None)
special
Method generated by attrs for class TaskLight.
Source code in aqueduct/models/task.py
def __attrs_init__(self, id, name, disabled, actionType, actionDescription, actionDescriptorImageId, actionDescriptorName, valid, migrated=attr_dict['migrated'].default, deprecated=attr_dict['deprecated'].default, applicationId=attr_dict['applicationId'].default, actionDescriptorVendor=attr_dict['actionDescriptorVendor'].default, actionDescriptorProduct=attr_dict['actionDescriptorProduct'].default, actionDescriptorVersion=attr_dict['actionDescriptorVersion'].default, description=attr_dict['description'].default):
self.id = id
self.name = name
self.disabled = disabled
self.actionType = actionType
self.actionDescription = actionDescription
self.actionDescriptorImageId = actionDescriptorImageId
self.actionDescriptorName = actionDescriptorName
self.valid = valid
self.migrated = migrated
self.deprecated = deprecated
self.applicationId = applicationId
self.actionDescriptorVendor = actionDescriptorVendor
self.actionDescriptorProduct = actionDescriptorProduct
self.actionDescriptorVersion = actionDescriptorVersion
self.description = description