设置Visual Workflow跟踪时出现问题 [英] Issue in setting up Visual Workflow Tracking

查看:220
本文介绍了设置Visual Workflow跟踪时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了SDK中的WorkflowSimulator示例在重新托管的解决方案上设置了可视化工作流跟踪,但遇到了以下问题:

1.而不是直接从需要使用WorkflowDesigner.Load方法加载Workflow的方法文件路径中,我使用了带AcitivityBuilder的重载.结果,以下代码中的LoadFile属性为null.即使在对XAML文件的物理文件路径进行硬编码之后,sourceLocationMapping集合也不会返回任何项目.它工作的唯一方法是使用WorkflowDesigner的Load方法上的文件路径重载来加载Workflow.这是期望的行为吗?如何在通过ActivityBuilder加载的工作流上运行Visual Workflow Tracking?以及在我将XAML保留在数据库中而根本不想使用文件系统的情况下呢?

活动documentRootElement = GetRootActivity(rootInstance);
          ;    SourceLocationProvider.CollectMapping(GetRootRuntimeWorkflowElement(),documentRootElement,sourceLocationMapping,
   workshopDesigner.Context.Items.GetValue< WorkflowFileItem>().LoadedFile);
   SourceLocationProvider.CollectMapping(documentRootElement,documentRootElement,designerSourceLocationMapping,
workflowDesigner.Context.Items.GetValue< WorkflowFileItem>().LoadedFile);
}

2. GetRootRuntimeWorkflowElement方法中的代码可与提供的示例工作流程一起使用.但是对于在重新托管环境中创建的工作流,我不得不调整代码以跳过文字(如果存在任何工作流级别参数)以返回根活动.

while(enumerator1.MoveNext())
           {
             
               if(enumerator1.Current.Id.Equals("1.1"))
           ; {
               root = enumerator1.Current;
              break;
               }
           }
           return root;

该问题仅适用于在重新托管环境中创建的工作流.在Visual Studio中创建的工作流确实显示正确的根活动,而不管工作流级别的参数如何.

我不确定问题出在哪里?对于来自Visual Studio和重新托管环境的相同工作流,我可以清楚地看到XAML的差异.如何构建类似于Visual Studio的XAML?

I used the WorkflowSimulator example from SDK to setup visual workflow tracking on my re-hosted solution but I ran into following problems:

1. Rather than directly loading Workflow from WorkflowDesigner.Load method that takes file path, I used the overload which takes AcitivityBuilder. As a result the LoadFile property in the code below was null. Even after hard coding the physical file path of XAML file the sourceLocationMapping collection did not return any item. The only way it worked was by loading the Workflow using file path overload on Load method of WorkflowDesigner. Is this the desired behavior? How can I run Visual Workflow Tracking on workflows loaded through ActivityBuilder? And how about cases where I persist XAML in database and do not want to use file system at all. How do I perform debugging in that scenario?

Activity documentRootElement = GetRootActivity(rootInstance);
                SourceLocationProvider.CollectMapping(GetRootRuntimeWorkflowElement(), documentRootElement, sourceLocationMapping,
                    workflowDesigner.Context.Items.GetValue<WorkflowFileItem>().LoadedFile);
                SourceLocationProvider.CollectMapping(documentRootElement, documentRootElement, designerSourceLocationMapping,
                   workflowDesigner.Context.Items.GetValue<WorkflowFileItem>().LoadedFile);
            }

2. The code in GetRootRuntimeWorkflowElement method works with the provided sample workflow  but for workflows created in re-hosted environment I had to tweak the code to skip literals (if there were any workflow level arguments) to return the root activity.

 while (enumerator1.MoveNext())
            {
              
                if (enumerator1.Current.Id.Equals("1.1"))
                {
                    root = enumerator1.Current;
                    break;
                }
            }
            return root;

The problem comes only for workflows created in re-hosted environment. Workflows created in Visual Studio does show correct root activity irrespective of arguments at workflow level.

I am not sure where the problem is? I can clearly see differences in XAML for the same workflow from Visual Studio and re-hosted environment. How do I build XAML similar to the one from Visual Studio?

推荐答案

关于1,

这可能是预期的这些API的行为.

如果您不告诉重新托管的应用有关文件的任何信息,则文件的概念不存在.我相信您可以致电ContextItem.Items.SetValue< WorkflowFileItem>() .还是在您的代码上方,为什么不直接将文件名传递给CollectMapping?
Regarding 1,

This is probably the expected behavior of these APIs.

No concept of File exists if you didn't tell the rehosted app any info about the file. I believe you can call ContextItem.Items.SetValue<WorkflowFileItem>() though. Or in your code above why not pass the file name to CollectMapping directly?


这篇关于设置Visual Workflow跟踪时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆