<?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: Access JobID from .NET class extension in ArcGIS Workflow Manager Questions</title>
    <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473206#M928</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heather,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to retrieve the Job or the JobID from the IJTXExtension interface on the Extension. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IJTXExtension extension = m_application.FindExtensionByName("Workflow Manager") as IJTXExtension;
int jobID = extension.JobID;
IJTXJob job = extension.Job;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the job, you can get the status. If you are following this approach and always getting 0 as the JobID, you may be trying to retrieve this value before the job has actually been loaded. In that case, you may need to wait for the job to be loaded by registering as a Job Listener, via IJTXExtension2.AttachListener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:55:35 GMT</pubDate>
    <dc:creator>KevinBedel</dc:creator>
    <dc:date>2021-12-11T20:55:35Z</dc:date>
    <item>
      <title>Access JobID from .NET class extension</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473205#M927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am migrating a 9.3 system to 10.2.2 and part of that is upgrading a number of VB.NET class extensions that we put in place for data validation. Part of what these class extensions do is ensure that users can only edit data from within a JTX job (not generic ArcMap). The logic assumes that if the JobID is greater than 0 then the work is being done from within a valid job.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I access the JobID and JobStatus in .NET from Workflow Manager? My existing 9.3 solution isn't working (JobID is always 0)...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Heather&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 15:36:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473205#M927</guid>
      <dc:creator>AllWeatherHeather</dc:creator>
      <dc:date>2014-05-15T15:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Access JobID from .NET class extension</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473206#M928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heather,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to retrieve the Job or the JobID from the IJTXExtension interface on the Extension. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IJTXExtension extension = m_application.FindExtensionByName("Workflow Manager") as IJTXExtension;
int jobID = extension.JobID;
IJTXJob job = extension.Job;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the job, you can get the status. If you are following this approach and always getting 0 as the JobID, you may be trying to retrieve this value before the job has actually been loaded. In that case, you may need to wait for the job to be loaded by registering as a Job Listener, via IJTXExtension2.AttachListener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:55:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473206#M928</guid>
      <dc:creator>KevinBedel</dc:creator>
      <dc:date>2021-12-11T20:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Access JobID from .NET class extension</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473207#M929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Kevin!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, we are still having issues... this is our code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim pEX As IExtension = pApplication.FindExtensionByName("workflow manager")
If Not pApplication.FindExtensionByName("workflow manager") Is Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ext As IExtension = CType(pEX, IExtension)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pJTXEX As IJTXExtension3 = CType(ext, IJTXExtension3) 'TryCast(pApplication.FindExtensionByName("workflow manager"), IJTXExtension4)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pJob As IJTXJob2 = CType(pJTXEX.Job, IJTXJob2)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error messages we receive are attached. This code works with our old JTX 9.3 environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]34833[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473207#M929</guid>
      <dc:creator>AllWeatherHeather</dc:creator>
      <dc:date>2021-12-11T20:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Access JobID from .NET class extension</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473208#M930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Heather,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I unable to reproduce that issue with your code in a sample VB.Net ArcMap command. I have attached the project I used in the hope that you will be able to discover some difference between it and your project that may help resolve the issue. If this project does not work for you, I suspect the issue may have something to do with your specific configuration or Workflow Manager repository, and you will probably need to contact Esri Support in order to help resolve the issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 14:22:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473208#M930</guid>
      <dc:creator>KevinBedel</dc:creator>
      <dc:date>2014-06-24T14:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Access JobID from .NET class extension</title>
      <link>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473209#M931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the code. We are getting the same issue with your code as we were seeing with ours. I have contact Esri Support in Canada to see if they can help us get the configuration sorted out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 13:44:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-workflow-manager-questions/access-jobid-from-net-class-extension/m-p/473209#M931</guid>
      <dc:creator>AllWeatherHeather</dc:creator>
      <dc:date>2014-06-25T13:44:08Z</dc:date>
    </item>
  </channel>
</rss>

