简体   繁体   中英

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. 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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