HomeGuidesAPI ReferenceChangelogDiscussions
GuidesiMIS ProfessionaliMIS EnterpriseClient SupportLog In
Discussions

Discussions

Ask a Question
Back to All

Executes a TaskDefinition operation - possible with variables?

Hi
I want to execute a Process Automation Task with a POST request to https://yourorgsite.com/api/TaskDefinition/_execute and the body
{
"$type": "Asi.Soa.Communications.DataContracts.TaskAdhocRequest, Asi.Contracts",
"EntityTypeName": "TaskDefinition",
"OperationName": "TaskAdhocRequest",
"Task": {
"$type": "Asi.Soa.Communications.DataContracts.TaskDefinitionData, Asi.Contracts"
}
}

The task would look like this
{
"$type": "Asi.Soa.Communications.DataContracts.TaskDefinitionData, Asi.Contracts",
"TaskDefinitionId": "aa71f95f-4779-4db5-9d4a-dc9f604904ec",
"Name": "Send Email from Flowz",
"Description": "",
"IsActive": true,
"Priority": 0,
"TaskType": 1,
"Triggers": {
"$type": "Asi.Soa.Communications.DataContracts.TaskDefinitionTriggerDataCollection, Asi.Contracts",
"$values": []
},
"Evaluations": {
"$type": "Asi.Soa.Communications.DataContracts.TaskDefinitionEvaluationDataCollection, Asi.Contracts",
"$values": []
},
"DataSources": {
"$type": "Asi.Soa.Communications.DataContracts.DataSourceDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Communications.DataContracts.DataSourceQueryData, Asi.Contracts",
"Query": {
"$type": "Asi.Soa.Core.DataContracts.QueryData, Asi.Contracts",
"Criteria": {
"$type": "Asi.Soa.Core.DataContracts.CriteriaDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.CriteriaData, Asi.Contracts",
"Operation": 3,
"PropertyName": "QueryDocumentVersionKey",
"Values": {
"$type": "System.Collections.ObjectModel.Collection`1[[System.String, mscorlib]], mscorlib",
"$values": [
"56e9abd1-a01d-4e99-aa52-98aa844603cd"
]
}
}
]
},
"EntityTypeName": "IQA"
},
"DataSourceId": "5eefeb65-0390-4ead-a034-51b9bbdf9623",
"DataSourceName": "EmailByID"
}
]
},
"Actions": {
"$type": "Asi.Soa.Communications.DataContracts.TaskDefinitionActionDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Communications.DataContracts.TaskDefinitionActionCommunicationJobData, Asi.Contracts",
"ActionId": "78675ff1-e8fc-4fa7-9174-cbd4403abf84",
"ActionTypeName": "CommunicationJob",
"Description": "Sample for CT",
"RecipientDatasourceId": "5eefeb65-0390-4ead-a034-51b9bbdf9623",
"CommunicationTemplateId": "34236ea0-a33a-4d52-ba2f-02cdd5572458",
"ActionNotification": null
}
]
},
"Notifications": {
"$type": "Asi.Soa.Communications.DataContracts.NotificationDefinitionDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Communications.DataContracts.NotificationDefinitionData, Asi.Contracts",
"NotificationDefinitionId": "4520a0e3-02d1-4341-bcb1-9d1754d94fb3",
"TaskDefinitionId": "aa71f95f-4779-4db5-9d4a-dc9f604904ec",
"DefaultTemplate": "",
"PersonalizedTemplate": "",
"DataSources": {
"$type": "Asi.Soa.Communications.DataContracts.DataSourceIdentifiers, Asi.Contracts",
"$values": []
}
}
]
},
"UpdateInformation": {
"$type": "Asi.Soa.Core.DataContracts.EntityUpdateInformationData, Asi.Contracts",
"CreatedBy": "BRIANM",
"CreatedOn": "2021-02-23T14:08:30.173",
"UpdatedBy": "BRIANM",
"UpdatedOn": "2021-02-23T14:13:16.803"
}
}

It contains a data source (IQA) with a required filter.
How can I pass in the filter to the IQA?

If I would use the simpler approach by triggering an already setup task,
{
"$type": "Asi.Soa.Communications.DataContracts.TaskRequest, Asi.Contracts",
"EntityTypeName": "TaskDefinition",
"OperationName": "TaskAdhocRequest",
"TaskDefinitionId": "aa71f95f-4779-4db5-9d4a-dc9f604904ec"
}
how can I pass in the query parameter?

Any pointers are much appreciated!
Best,
Alex

Contact us
Copyright © Advanced Solutions International, All rights reserved.