run program from C# component called within orchestration

Home Page Forums BizTalk 2004 – BizTalk 2010 run program from C# component called within orchestration

Viewing 1 reply thread
  • Author
    Posts
    • #14201

      Hi

      I’m calling the method of a component within an expression shape of my orchestration.

      I want the C# code within my component to run an external program, so I am using:
      System.Diagnostics.Process.Start()

      From my expression shape I am calling the method that contains the above code:

      ComponentName.ComponentClass.ComponentMethod()

      Can anyone tell me what I should be passing into the Start method as a parameter?
      If I want to run an external program called \”DoStuff.exe\” would my C# code look like this? :

      System.Diagnostics.Process.Start(\”DoStuff.exe\”)

      Do I have to specify the exact path of the program or have to pass in any other arguments?

      Any help is appreciated.
      Cheers

    • #15597

      Hi

      I have now resolved my problem.

      Within my component I defined my process within a System.Diagnostics.ProcessStartInfo object. The function that contained this code returns true or false depending on whether the process ran. From within my orchestration (message assignment shape) I created an instance of my process object, set an orchestration defined variable to the return value of my process (true or false) and assigned that value to a node within my outgoing message. So my orchestration completed, messages were sent and the process (an exe) was executed on the server successfully (writing content to a text file in this case).

      Cheers

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.