How to find out if a service task has been terminated?

How do I find out if a service task has been terminated? Is it possible to figure this out through groovy script?

Hi,

You can use the searchArchivedActivities method from processApi. You can do that in a Groovy script. Here is an example where I retrieve all the archived activity instances that called “Step1”.

SearchOptionsBuilder searchOptionsBuilder = new SearchOptionsBuilder(0, 100); searchOptionsBuilder.filter(ArchivedActivityInstanceSearchDescriptor.NAME, "Step1"); SearchOptions searchOptions = searchOptionsBuilder.done();
        SearchResult<ArchivedActivityInstance> archivedActivityInstances =  processApi.searchArchivedActivities(searchOptions);
        
        for (ArchivedActivityInstance archivedAI : archivedActivityInstances.getResult()) {
            // Do something
        }

Yes,

have a look at

CANCELLED_STATE - Static variable in class org.bonitasoft.engine.bpm.flownode.ActivityStates

in API documentation, it will lead you to what you want

regards
Seán

PS: As this reply answers your question, please mark as resolved.