01-12-2010 03:47 PM
I am trying to programmatically launch different sequences then look at the final results. The results of the execution always show the results from the first call to
TS_ExecutionGetResultStatus. Even if I execute a different sequence. Is there a method to close the last execution results?
Thanks,
Mike
Here is a code snippet of what I am doing.
tsErrChk(TSUI_SequenceFileViewMgrRun (tsoHandles.sequenceFileViewMgr, &errorInfo, CA_DEFAULT_VAL, NULL));
CA_DiscardObjHandle(tsoHandles.Executions);
tsErrChk(TSUI_ApplicationMgrGetExecutions(tsoHandles.applicationMgr, &errorInfo, &tsoHandles.Executions));
tsErrChk(TSUI_ExecutionsGetItem(tsoHandles.Executions, &errorInfo, 0, &tsoHandles.Execution));
if (bWait)
{ // Wait
while (Test_Running())
{ // Running
ProcessSystemEvents();
iCount++;
} // Running
} // Wait
tsErrChk(TS_ExecutionGetResultStatus(tsoHandles.Execution, &errorInfo, &szResults));
if (strcmp(szResults, "Passed") == 0)
bRet = TRUE;
if (strcmp(szResults, "Failed") == 0)
bRet = FALSE;
Solved! Go to Solution.
01-13-2010 10:36 AM
I think one of the following should work:
TSUI_ApplicationMgrCloseExecution()
TSUI_ApplicationMgrCloseAllExecutions()
Hope this helps,
-Doug
01-13-2010 12:15 PM
Hi Doug,
Thanks. I found that function this morning. It works great.
Mike
01-13-2010 01:01 PM
Hey Mike,
It looks like you're on the right track but from the code you pasted you are always referencing the same execution. Because the TS_ExecutionGetResultStatus function just returns the status of whichever Execution object you decide to pass it, you first should verify that you passing it the correct object. When you call the TSUI_ExecutionsGetItem function:
tsErrChk(TSUI_ExecutionsGetItem(tsoHandles.Executions, &errorInfo, 0, &tsoHandles.Execution));
you are passing a value of zero for the ItemIdx input. Try changing your value from 0 to any number between 1 and one less than the result of TSUI_ExecutionsGetCount (because of zero indexing). Give this a try and see if this helps.
Lars
01-13-2010 01:20 PM
Hi Lars,
You are correct. This was just some test code I threw together. What I am going to do is this:
tsErrChk(TSUI_ExecutionsGetCount(tsoHandles.Executions, &errorInfo, &iRunning)
tsErrChk(TSUI_ExecutionsGetItem(tsoHandles.Executions, &errorInfo, (iRunning - 1), &tsoHandles.Execution));
I believe this should get me the correct execution since it should be the last one.
Thanks,
Mike