hello, My callback function is not working, please help
public function Dynamic autoCloseStep( \
Object prgCtx, \
WAPIWORK work, \
Integer workID, \
Integer subWorkID, \
Integer taskID, \
Integer returnSubWorkID, \
Integer returnTaskID, \
Dynamic extraData = Undefined )
Object tempPrgCtx = prgCtx
// Create admin session
String cnctName = $Kernel.SystemPreferences.GetPrefGeneral('DftConnection')
Assoc prgAssoc = $LLIApi.PrgSession.CreateNewNamed(cnctName, {"Admin", Undefined})
Object adminPrgCtx = prgAssoc.pSession
// Get Workflow API admin session
Object workflowAPI = $WFMain.Workflow.GetAPI(adminPrgCtx)
// ID of the step to be closed automatically
Integer targetStepId = 7
// Get task/step by ID
Object targetTask = workflowAPI.GetTaskById(targetStepId)
if ( IsDefined(targetTask) && !targetTask.IsCompleted() )
// close task
workflowAPI.CompleteTask(targetTask.GetId())
end
// Restoring the original context
prgCtx = tempPrgCtx
return True
end