Receive return code 20887 error while canceling Object with Script Function "CANCEL_UC_OBJECT"

Document ID : KB000085034
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Error Message :
U00020408 Cancel of 0001321871 returned 0000000000020887

When using UC_CANCEL_OBJECT as a script in a Workflow to cancel an Object which was started in the same Workflow via ACTIVATE_UC_OBJECT and which still has the status of 1572 (Generating), the script UC_CANCEL_OBJECT returns the above error message.
 
Investigation:
 
The following script is used in a Workflow to cancel an object which was activated before with UC_ACTIVE_OBJECT:
 
:SET &PATIENCE_STATUS# = GET_UC_OBJECT_STATUS(JOBS, &PATIENCE_RUNID#)
:P PATIENCE_STATUS# = &PATIENCE_STATUS#
:SET &CANCEL# = CANCEL_UC_OBJECT(&PATIENCE_RUNID#, " ENDED_OK")
:P Cancel of &PATIENCE_RUNID# returned &CANCEL#

Results

Actual:  
The script ends with the above Error Message.

Expected: The script runs without errors.


 
Environment:
OS Version: N/A
Cause:
Cause type:
Configuration
Root Cause: The problem is the additional parameter "ENDED_OK".
Resolution:
The problem is the additional parameter "ENDED_OK". This is only valid for event objects.
If used for other objects, an error code is returned, because a task in a state of "generating" can not be set to an ENDED_OK.

Correct the script in the description above as follows to avoid the error:

 
:SET &PATIENCE_STATUS# = GET_UC_OBJECT_STATUS(JOBS, &PATIENCE_RUNID#)
:P PATIENCE_STATUS# = &PATIENCE_STATUS#
:SET &CANCEL# = CANCEL_UC_OBJECT(&PATIENCE_RUNID#)
:P Cancel of &PATIENCE_RUNID# returned &CANCEL#


Fix Status: No Fix

Fix Version(s):
N/A
Additional Information:
Workaround :
N/A