How to Archive a case that is still active

Hello Community

I have several cases which are assigned to different users but they don't want to take any action. These cases have been lying with users for more than 1 year.
I don't want to delete the case but I want to archive the case.

Is there a way to archive an active case by passing the case id. ?

 

Please point me to a Java API or Rest Api

Thanks

Hi,

You can use the processApi.cancelProcessInstance(processInstanceId) method.
There is no REST API equivalent in provided api.

HTH
Romain

Thank you Romain, I will check out this method. 

Working script.

 

import org.bonitasoft.engine.api.LoginAPI;
import org.bonitasoft.engine.bpm.connector.ConnectorInstance;
import org.bonitasoft.engine.bpm.connector.ConnectorInstancesSearchDescriptor;
import org.bonitasoft.engine.bpm.connector.ConnectorState;
import org.bonitasoft.engine.bpm.connector.ConnectorStateReset;
import org.bonitasoft.engine.search.Order;
import org.bonitasoft.engine.search.SearchOptions;
import org.bonitasoft.engine.search.SearchOptionsBuilder;
import org.bonitasoft.engine.search.SearchResult;
import org.bonitasoft.engine.session.APISession;
import com.bonitasoft.engine.api.LogAPI;
import com.bonitasoft.engine.api.ProcessAPI;
import com.bonitasoft.engine.api.TenantAPIAccessor;
import com.bonitasoft.engine.log.Log;
import com.bonitasoft.engine.log.LogSearchDescriptor;

 apiAccessor.processAPI.cancelProcessInstance(16003);