Document Understanding: Only activities which have been requested to cancel can call MarkCanceled

Hello all,

I am working with the document understanding framework along with a parallel for each loop. This error is infrequent, but it is still one I would like to fix. Occasionally in the Extraction scope the following error is thrown:

Current Document Extraction: Only activities which have been requested to cancel can call MarkCanceled. Check ActivityInstance.HasCancelBeenRequested before calling this method.

However I have not canceled any part of my workflow in studio or orchestrator. I also have tried using the ActivityInstance.HasCancelBeenRequested but I get an error that it is not a part of ActivityInstance. This only happens occasionally and I have not been able to find a pattern to it. Has anyone else run into this issue or have a possible solution?

Does anyone have any guidance on this issue?

I believe I have found the answer to my own question. When testing, occasionally if there was another error in my program I wouldn’t complete the actions in orchestrator because the program had failed and I would apply a fix. Because of this, and because I would send the names of the files as the action name, it would see the previous actions as canceled since there would be duplicate action names. To fix this, I am not only sending the file name but a time stamp as well for the action name and the issue does not seem to appear anymore.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.