I have a Workflow service (xamlx) which host in WCF and use configuration file to persist the instanceID in oracle.
In the client application, I can call the receive activity in the workflow to create the new instance ID. However, we can't resume the existing workflow by providing the instanceID in IContextManager. A new instanceID was created even we add the instanceID in the IContextManager before calling the service.
So, do we missing any step on it? Thanks!
Code: Select all
Binding binding = new System.ServiceModel.BasicHttpContextBinding();
ServiceReference1.ServiceClient proxy = new ServiceReference1.ServiceClient();
proxy.Start(123); //New Instance ID was created at this time.
ServiceReference1.StartRequest request1 = new ServiceReference1.StartRequest();
ServiceReference1.IService _ServiceChannel4 = new ChannelFactory<ServiceReference1.IService>(binding, new EndpointAddress("http://localhost/WorkflowEngine/sequence.xamlx")).CreateChannel();
IContextManager context4 = (_ServiceChannel4 as IClientChannel).GetProperty<IContextManager>();
IDictionary<string, string> instanceIdContext4 = new Dictionary<string, string>();
instanceIdContext4.Add("instanceId", "c4489161-0983-4548-8a03-c694ab8b9201");
context4.SetContext(instanceIdContext4);
_ServiceChannel4.Start(request1); //Should use the existing InstanceID, but a new one was created in database.