WF - 如何從XAML工作流中獲取WorkflowInvoker結果

[英]WF - How to get the WorkflowInvoker result from a XAML workflow


I have a simple workflow in XAML composed by a sequence and a custom activity. In the future there will be more activities. The XAML is the following:

我在XAML中有一個由序列和自定義活動組成的簡單工作流程。將來會有更多的活動。 XAML如下:

<Activity mc:Ignorable="sap sap2010 sads" 
...
  <Sequence sap2010:WorkflowViewState.IdRef="Sequence_1">
    <local:CoefficientWorkflow sap2010:WorkflowViewState.IdRef="CoefficientWorkflow_1">
    </local:CoefficientWorkflow>
    <sads:DebugSymbol.Symbol>d11DOlxGQU1FMlxQcm9qZWN0MDJcRkJTXFdlYkFwcFxNb2R1bGVzXEZCUy5BTE9cc3JjXEZCUy5BTE8uV29ya2Zsb3dcV29ya2Zsb3dzXEFsb1dvcmtmbG93LnhhbWwDKwM0DgIBASwFMiECAQIvCy9KAgED</sads:DebugSymbol.Symbol>
  </Sequence>
  <sap2010:WorkflowViewState.ViewStateManager>
    <sap2010:ViewStateManager>
      <sap2010:ViewStateData Id="CoefficientWorkflow_1" sap:VirtualizedContainerService.HintSize="200,22" />
      <sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="222,146">
        <sap:WorkflowViewStateService.ViewState>
          <scg:Dictionary x:TypeArguments="x:String, x:Object">
            <x:Boolean x:Key="IsExpanded">True</x:Boolean>
          </scg:Dictionary>
        </sap:WorkflowViewStateService.ViewState>
      </sap2010:ViewStateData>
      <sap2010:ViewStateData Id="FBS.ALO.Workflow.Workflows.AloWorkflow_1" sap:VirtualizedContainerService.HintSize="262,226" />
    </sap2010:ViewStateManager>
  </sap2010:WorkflowViewState.ViewStateManager>
</Activity>

I invoke the workflow with the following code:

我使用以下代碼調用工作流程:

WorkflowInvoker invoker = new WorkflowInvoker(workflow1);
var result = invoker.Invoke();

At the moment the result variable contains an empty dictionary after invoking the workflow. As the activity contained in the sequence returns a value, I need your help to grab the output of that activity and expose externally as result of the whole workflow.

目前,結果變量在調用工作流后包含空字典。由於序列中包含的活動返回一個值,我需要您的幫助來獲取該活動的輸出並作為整個工作流的結果在外部公開。

1 个解决方案

#1


0  

The result will hold an output dictionary.

結果將保存輸出字典。

The keys for the dictionary are any OUT Arguments you created in your workflow at the workflow level.

字典的鍵是您在工作流級別在工作流中創建的任何OUT參數。

The value returned by the Activity must first be passed from the Activity into a Workflow level OUT Argument.
You do this by creating an OUT Argument in the Activity and assigning it to the OUT Argument in the Workflow using the Activity Properties dialog in Visual Studio

必須首先將Activity返回的值從Activity傳遞到Workflow級別OUT Argument。您可以通過在Activity中創建OUT參數並使用Visual Studio中的“活動屬性”對話框將其分配給工作流中的OUT參數來完成此操作


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2016/12/05/72a3806086df5704bae3c20513290b98.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com