简体   繁体   English

以编程方式生成工作流服务

[英]Generate a workflow service programmatically

I am working on an asp .net project which I develop a workflow service according to some selections of the user. 我正在开发一个asp .net项目,我根据用户的一些选择开发工作流服务。 When the user follow the appropriate steps it generates a flowchart. 当用户按照适当的步骤操作时,它会生成一个流程图。 This flowchart is added to the body of a workflow service at the end with the following code. 此流程图最后使用以下代码添加到工作流服务的主体中。

          Flowchart flowchart = new Flowchart();
          flowchart = (Code to fill the flowchart)...

            Receive reserveSeat = new Receive();

            WorkflowService service = new WorkflowService()
        {

            Body = flowchart,
            Endpoints ={
            new Endpoint
            {
            ServiceContractName="IService",
            AddressUri = new Uri("http://localhost:2757"),
            Binding = new BasicHttpBinding(),
            }

            }
        };

Is there a way to add a Receive activity inside the body at the above code and not touch the flowchart?. 有没有办法在上面的代码中添加接收活动,而不是触摸流程图? I tried 我试过了

Body = reserveSeat + flowchar, 

But is not working. 但是没有用。 Any ideas? 有任何想法吗?

You can add both the Receive activity and the flowchart as child activities of a Sequence activity 您可以将Receive活动和流程图都添加为Sequence活动的子活动

Body = new Sequence()
{
  Activities = {
   reserveSeat,
   flowchar
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM