How to call & pass the parameter to a workflow inside a workflow

Hi

I have a workflow inside which i m calling two another workflow simultaneously. The problem I am facing is that I am unable to pass the parameter to the child workflow and also unable to returning the parameter from the child process back to the parent process.

Also if anybody have any link from where i can get the sample which can solve my problem. Plz tell me.

Thanks

Kanhaiya




Answer this question

How to call & pass the parameter to a workflow inside a workflow

  • isaacb

    can u please provide me the example of ur case as i am working on the same scenario.
  • Pablo De Paulis

    Kanhaiya,

    Your scenario requires a Request-Response Message Exchange Pattern, where the request sends an information about the sender (in your case, it is the Parent's  WorkflowInstanceID) to the Reply (child) Workflow. This pattern (known such as half-duplex communication) is based on the two One-Way connectivities.

    You can build this One-Way Connectivity using the HandleExternalEvent/CallExternalMethod Activities pair. Note, that the parent's HEE Activities should be waited for the events in the ParallelActivity. 

     

    Another choice for your scenario is used the Adapter/Connector pair based on the Interface Contract, for example: 

     [ServiceContract]
      public interface IRequestResponse1
      {
        [OneWay]
        [OperationContract(IsOneWay = true)]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        void Request(Guid replyTo, string msg);
    
        [OneWay]
        [OperationContract(IsOneWay = true)]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        void Response(string msg);
      }
    

    Note, the above interface is decorated for WCF and Remoting communication models, so the sub workflows can be hosted in the same appDomain or across the process/machine boundary.

     

    Thanks

    Roman



  • How to call & pass the parameter to a workflow inside a workflow