🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

When using DataWatch API, the GetStatus() method does not give correct status

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

I used the DataWatch API to call the DataWatch process from a .NET program. I could call the correct process but I could not get the correct status from after the process is called.  I think it's because the GetStatus method does not wait for the StartProcess() method to finish.

 

I used the following code, I had to use Thread.Sleep to pause to get the status but then it is not reliable.  Is there any other way to get the correct status? I need to pass the status to the calling program to show whether the call is a success or failure.

 

Thanks for you help!

if (m_bLocal)
                        strTrackingID = PumpAPI.StartProcess(processName);
                    else
                    {
          

                        strTrackingID = WebService.StartProcess(processName);
                       
                        System.Threading.Thread.Sleep(2000);
                        int response = WebService.GetStatus(strTrackingID);
                        switch (response)
                        {
                            case 2:
                                jobStatus = true;
                                break;
                            case 3:
                                jobStatus = false;
                                break;
                            default:
                                jobStatus = false;
                                break;
                        }
                    }

Find more posts tagged with