<?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: How can I get the WorkflowToken of the current running Workflow? in vCenter Orchestrator Plug-in SDK Discussions</title>
    <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093934#M535</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lets see if this helps ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a property "endDate" for every Workflow token, which shows the date when this particular workflow token was finished executing. You could retrieve the current token of the workflow by sorting out all the tokens for that workflow in descending order of endDate, the first one being the current token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is what you are looking for and it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Mar 2010 09:39:37 GMT</pubDate>
    <dc:creator>admin</dc:creator>
    <dc:date>2010-03-29T09:39:37Z</dc:date>
    <item>
      <title>How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093931#M532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can I get the workflow token of the current running workflow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that it is possible to get the workflow token when I start the workflow with the execute method, but what about within an already running workflow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 07:59:38 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093931#M532</guid>
      <dc:creator>RainerVM</dc:creator>
      <dc:date>2010-03-26T07:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093932#M533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Rainer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am not sure if this is what you looking for, but you can try something with the user interaction, while the workflow is running. In the user interaction, you can take WorkFlowToken as the input parameter which would then populate the list of worklfow tokens present in the server system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 12:06:08 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093932#M533</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-03-26T12:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093933#M534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Angela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your fast reply, but no that's not what I'm looking for, to get the workflow execution list (WorkflowTokens) is no problem (using a Action or the 'User interaction' all possible).&lt;/P&gt;&lt;P&gt;My problem is to know which single token of these listed tokens is the token of the current running workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 13:59:33 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093933#M534</guid>
      <dc:creator>RainerVM</dc:creator>
      <dc:date>2010-03-26T13:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093934#M535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lets see if this helps ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a property "endDate" for every Workflow token, which shows the date when this particular workflow token was finished executing. You could retrieve the current token of the workflow by sorting out all the tokens for that workflow in descending order of endDate, the first one being the current token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is what you are looking for and it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 09:39:37 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093934#M535</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-03-29T09:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093935#M536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Angela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry this works also not, because during the execution of the workflow there is no endDate available. And doing the same with the startDate doesn't work either, because it could be that another workflow has been started a view milliseconds later than the current, then I would get the other one and not the current running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I found a way to get the current workflow token by myself, a bit tricky but it works &lt;IMG src="http://communities.vmware.com/images/emoticons/happy.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For everyone who is interested in - here you will find the code of an Action (I called it getCurrentWfToken):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input: none (but must be used within a workflow)&lt;/P&gt;&lt;P&gt;Output: WorkflowToken of the current running workflow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var objWfToken = null;&lt;/P&gt;&lt;P&gt;try {&lt;/P&gt;&lt;P&gt;var strAnswerUrl = workflow.getAnswerUrl().url;&lt;/P&gt;&lt;P&gt;var strWfTokenId = strAnswerUrl .replace(/^(\[\s\S]&lt;STRONG&gt;TokenId=)|(&amp;amp;returnUrl\[\s\S]&lt;/STRONG&gt;)$/g,"");&lt;/P&gt;&lt;P&gt;objWfToken = Server.findForType("WorkflowToken",strWfTokenId);&lt;/P&gt;&lt;P&gt;} catch (objErrMsg) {&lt;/P&gt;&lt;P&gt;System.error(objErrMsg);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return objWfToken;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 16:13:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093935#M536</guid>
      <dc:creator>RainerVM</dc:creator>
      <dc:date>2010-03-29T16:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093936#M537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get the workflowToken just with using the keyword "workflow" in a scriptable box. That will simplify your script a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 21:57:12 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093936#M537</guid>
      <dc:creator>cdecanini_</dc:creator>
      <dc:date>2010-06-01T21:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093937#M538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just for interest: What is "worklfow"? Is it an object? Is there a way to display all builtin "keywords"? I don't found it on the "VCO Developers Guide".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Ok, it is an object of type WorkflowToken -&amp;gt; WorkflowToken:ch.dunes.scripting.jsmodel.JSWorkflowToken@83bc732.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a list of the objects available in the scripting environment? Any documents?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Sephan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 14:34:47 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093937#M538</guid>
      <dc:creator>mcssschaefer</dc:creator>
      <dc:date>2011-08-18T14:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093938#M539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for pointing this out, I was trying to do that same thing as the original poster and looking through the scripting API I could not see this documented anywhere (the doco is pretty garbage).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much Appreciate. Very thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 20:37:42 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093938#M539</guid>
      <dc:creator>ashley186</dc:creator>
      <dc:date>2014-01-22T20:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the WorkflowToken of the current running Workflow?</title>
      <link>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093939#M540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the workflow object. I know it's misleading because the object name is "workflow" not "workflowToken" but I tested it. For example, if you want to log the ID and start date of the current running workflow, put the following code in a scriptable task inside the main workflow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;System&lt;/STRONG&gt;.log("Token ID: " + &lt;STRONG&gt;workflow&lt;/STRONG&gt;.id);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;System&lt;/STRONG&gt;.log("Token Start Date: " + &lt;STRONG&gt;workflow&lt;/STRONG&gt;.startDate);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;System&lt;/STRONG&gt;.log("Parent workflow name: " + &lt;STRONG&gt;workflow&lt;/STRONG&gt;.currentWorkflow.name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Mar 2018 23:52:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vCenter-Orchestrator-Plug-in-SDK/How-can-I-get-the-WorkflowToken-of-the-current-running-Workflow/m-p/2093939#M540</guid>
      <dc:creator>AliH201110141</dc:creator>
      <dc:date>2018-03-10T23:52:25Z</dc:date>
    </item>
  </channel>
</rss>

