Get External Value through HTML5 Viewer
Hi:
We are trying to retrieve from the HTML5 Viewer key/value data that is stored through SetExternalValue in one workflow using GetExternalValue in another workflow. The external value is assigned to an output argument of the second workflow. We have tried a variety of ways in capturing the data (output) but no luck.
One attempt is to subscribe to the WorkflowActivityCompletedEvent or WorkflowCompletedEvent and invoking the RunWorkflowById command and taking a look at the returned "args". It shows the outputs with the correct "keys" but the "values" are null. Curiously in Fiddler we can see the correct values returned with the response of the second request to the workflow after the command is invoked. The first workflow request seems to get the workflow parameters in json. The second request is a POST with the workflow parameters presumably to complete the GetExternalValue activity and retrieve the data. Fiddler shows these two requests but we can't programmatically capture the data. The "args" object is not the same as the response returned with the second workflow call. The outputs "values" are null in the "args" object.
Is there a really simple way of getting the output data via a "RunWorkflowWithArguments" perhaps? The idea is to include an "output" variable as an argument requirement that would be returned. Thought I saw this once in a GCE UC session or forum but cannot find reference to it again or seem to get it to work with my attempts. Or is there another solution?
Thanks,
Ralph
-
Hi Ralph,
I am sorry to be late. I think it is supposed to work as expected, however I am not very much sure about why it is not working in HTML5. Anyways, you could use the second argument as shown below:
this,app.eventRegistry.event("WorkflowCompletedEvent").subscribe(this, function (WorkflowCompletedEventArgs, outputsArray) {
if (WorkflowCompletedEventArgs.id == 'myWorkflowID')
{
alert(outputsArray[0].value);
}
});
This is a tested piece of code.
Regards,
Mohammad Ashraf0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar