Qlik Community

QlikView Integration

Discussion Board for collaboration on QlikView Integration.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

Creating External Event Triggered Task in Code

Hi All,

I'm trying to use the QlikView Api to create an external event triggered task.

I can create the task, but the external event triggered property is not added.

Can Anyone help out?

QMSClient qmsClient = new QMSClient();

DocumentTask documentTask = new DocumentTask();

ServiceKeyClientMessageInspector.ServiceKey = qmsClient.GetTimeLimitedServiceKey();

List<ServiceInfo> serviceList = qmsClient.GetServices(ServiceTypes.QlikViewDistributionService);

Guid qdsGuid = serviceList[0].ID;

List<DocumentNode> SourceDocuments = qmsClient.GetSourceDocuments(qdsGuid);

documentTask.QDSID = qdsGuid;

documentTask.Document = SourceDocuments[0];

documentTask.General = new DocumentTask.TaskGeneral();

documentTask.General.Enabled = true;

documentTask.General.TaskName = "Test MAlik";

documentTask.General.TaskDescription = "Test description MAlik";

documentTask.Triggering = new DocumentTask.TaskTriggering();

Guid triggerID = new Guid("e95ecd5a-683d-1d33-26bf-66e94ff08223");

List<Trigger> List_trigger = new List<Trigger>();

ExternalEventTrigger t = new ExternalEventTrigger();

t.Password = "ReloadDeloitte";

t.Type = TaskTriggerType.ExternalEventTrigger;

t.Enabled = true;

t.ID = triggerID;

List_trigger.Add(t);

documentTask.Triggering.Triggers = List_trigger;

documentTask.Scope = DocumentTaskScope.General;

documentTask.Triggering.TaskDependencies = null;

documentTask.Triggering.ExecutionAttempts = 1;

documentTask.Triggering.ExecutionTimeout = 1440;

qmsClient.SaveDocumentTask(documentTask);

Tags (3)