<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Start a task, wait for execution end and check task execution status using .NET in Management &amp; Governance</title>
    <link>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2087725#M25220</link>
    <description>&lt;P&gt;I found the solution the day after my post but forgot to close this post.&lt;/P&gt;
&lt;P&gt;Sorry about that.&lt;/P&gt;
&lt;P&gt;Below the methods I use to&amp;nbsp; start a task and poll the execution status :&lt;/P&gt;
&lt;PRE class="code highlight" lang="csharp"&gt;&lt;SPAN class="line" data-testid="content"&gt;        &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;private&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;static&lt;/SPAN&gt; String &lt;SPAN class="hljs-title"&gt;StartTask&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;RestClient restClient, String TaskId&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            String task_start_response = restClient.Post(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/task/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; +  TaskId + &lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/start/synchronous"&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;            &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt;&lt;SPAN class=""&gt; JObject.Parse(task_start_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"value"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;PRE class="code highlight" lang="csharp"&gt;&lt;SPAN class="line" data-testid="content"&gt;        &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;private&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;static&lt;/SPAN&gt; String &lt;SPAN class="hljs-title"&gt;GetExecutionStatus&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;RestClient restClient, String ExecutionId, String TaskId&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            String ResultId;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;            &lt;SPAN class="hljs-keyword"&gt;try&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                String execution_session_response = restClient.Get(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/executionSession/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; + ExecutionId);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                ResultId = JObject.Parse(execution_session_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"executionResult"&lt;/SPAN&gt;&lt;SPAN class=""&gt;][&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"id"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;            &lt;SPAN class="hljs-keyword"&gt;catch&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                String reloadtask_response = restClient.Get(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/reloadTask/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; + TaskId);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                ResultId = JObject.Parse(reloadtask_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"operational"&lt;/SPAN&gt;&lt;SPAN class=""&gt;][&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"lastExecutionResult"&lt;/SPAN&gt;&lt;SPAN class=""&gt;][&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"id"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            String execution_result_response = restClient.Get(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/executionResult/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; + ResultId);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            return JObject.Parse(execution_result_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"status"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;    }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 10:39:18 GMT</pubDate>
    <dc:creator>covering</dc:creator>
    <dc:date>2023-06-26T10:39:18Z</dc:date>
    <item>
      <title>Start a task, wait for execution end and check task execution status using .NET</title>
      <link>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2077050#M25085</link>
      <description>&lt;P&gt;We use the PowerShell module "Qlik-CLI" for years to start Qlik Sense tasks, wait for task execution end and check execution status.&lt;BR /&gt;Due to recurrent issues with out enterprise Security tools about the PowerShell module "Qlik-CLI" we need to switch to another technology and we are trying the &lt;SPAN&gt;Øystein Kolsrud's C#/.NET library "Qlik.Sense.RestClient" available on github and nuget. This library is not documented for our purpose : we can start a task with the method RestClient.Post but we are not able to get the response and get the execution ID needed to poll the execution status.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could you please provide a solution to start a Qlik Sense task in .NET/C#, wait for execution end and check the status.&lt;BR /&gt;Thanks in advance for your answer.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:45:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2077050#M25085</guid>
      <dc:creator>covering</dc:creator>
      <dc:date>2024-11-15T21:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Start a task, wait for execution end and check task execution status using .NET</title>
      <link>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2077051#M25086</link>
      <description>&lt;P&gt;I realized I posted in "QlikView Integrations". Sorry about that. Would it be possible to move this request to Qlik Sense ?&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 15:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2077051#M25086</guid>
      <dc:creator>covering</dc:creator>
      <dc:date>2023-05-28T15:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Start a task, wait for execution end and check task execution status using .NET</title>
      <link>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2077445#M25087</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/70821"&gt;@covering&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;I moved this post to the Qlik Sense &amp;gt; Deployment &amp;amp; Management forum as you requested.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2023 19:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2077445#M25087</guid>
      <dc:creator>Chip_Matejowsky</dc:creator>
      <dc:date>2023-05-29T19:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Start a task, wait for execution end and check task execution status using .NET</title>
      <link>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2087725#M25220</link>
      <description>&lt;P&gt;I found the solution the day after my post but forgot to close this post.&lt;/P&gt;
&lt;P&gt;Sorry about that.&lt;/P&gt;
&lt;P&gt;Below the methods I use to&amp;nbsp; start a task and poll the execution status :&lt;/P&gt;
&lt;PRE class="code highlight" lang="csharp"&gt;&lt;SPAN class="line" data-testid="content"&gt;        &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;private&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;static&lt;/SPAN&gt; String &lt;SPAN class="hljs-title"&gt;StartTask&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;RestClient restClient, String TaskId&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            String task_start_response = restClient.Post(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/task/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; +  TaskId + &lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/start/synchronous"&lt;/SPAN&gt;&lt;SPAN class=""&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;            &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt;&lt;SPAN class=""&gt; JObject.Parse(task_start_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"value"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;PRE class="code highlight" lang="csharp"&gt;&lt;SPAN class="line" data-testid="content"&gt;        &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;private&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;static&lt;/SPAN&gt; String &lt;SPAN class="hljs-title"&gt;GetExecutionStatus&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;RestClient restClient, String ExecutionId, String TaskId&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            String ResultId;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;            &lt;SPAN class="hljs-keyword"&gt;try&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                String execution_session_response = restClient.Get(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/executionSession/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; + ExecutionId);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                ResultId = JObject.Parse(execution_session_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"executionResult"&lt;/SPAN&gt;&lt;SPAN class=""&gt;][&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"id"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;            &lt;SPAN class="hljs-keyword"&gt;catch&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            {&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                String reloadtask_response = restClient.Get(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/reloadTask/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; + TaskId);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;                ResultId = JObject.Parse(reloadtask_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"operational"&lt;/SPAN&gt;&lt;SPAN class=""&gt;][&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"lastExecutionResult"&lt;/SPAN&gt;&lt;SPAN class=""&gt;][&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"id"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            String execution_result_response = restClient.Get(&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"/qrs/executionResult/"&lt;/SPAN&gt;&lt;SPAN class=""&gt; + ResultId);&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;            return JObject.Parse(execution_result_response)[&lt;/SPAN&gt;&lt;SPAN class="hljs-string"&gt;"status"&lt;/SPAN&gt;&lt;SPAN class=""&gt;].Value&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="hljs-built_in"&gt;string&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;        }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="line" data-testid="content"&gt;&lt;SPAN class=""&gt;    }&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 10:39:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Start-a-task-wait-for-execution-end-and-check-task-execution/m-p/2087725#M25220</guid>
      <dc:creator>covering</dc:creator>
      <dc:date>2023-06-26T10:39:18Z</dc:date>
    </item>
  </channel>
</rss>

