# \[BONITA 6.2 API\] get archived process instance by processInstanceId

**URL:** <https://community.ofelia.com/t/bonita-6-2-api-get-archived-process-instance-by-processinstanceid/5251>\
**Category:** Q&A\
**Created:** [9 October 2014 16:49 UTC](https://community.ofelia.com/t/bonita-6-2-api-get-archived-process-instance-by-processinstanceid/5251 "2014-10-09T16:49:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul33](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@paul33](https://community.ofelia.com/u/paul33)\
**Post date:** [9 October 2014 16:49 UTC](https://community.ofelia.com/t/bonita-6-2-api-get-archived-process-instance-by-processinstanceid/5251/1 "2014-10-09T16:49:07Z")

</div>

Hi there,

I’d like to be able to check on a process instance state to know wether it still need informations or if it’s finished (Archived)

When it’s not closed, i do : processAPI.getProcessInstance(processInstanceId).getState()  
but how can i know when it’s closed with the same processInstanceId ?

Thanks for any help.  
Paul

---

<div class="post-metadata">

**Author:** ![paul33](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@paul33](https://community.ofelia.com/u/paul33)\
**Post date:** [15 October 2014 07:27 UTC](https://community.ofelia.com/t/bonita-6-2-api-get-archived-process-instance-by-processinstanceid/5251/2 "2014-10-15T07:27:14Z")

</div>

Hi Seán, thanks for the help.

I’ve tried ArchivedProcessInstance but i couldn’t make it work with processInstanceId…  
and getState has the same problem as I can’t find the processInstanceId of the process once it has been archived.

It’s not a problem of validator. It’s just that I want to check on the progression of my process from an outside application.

I got around my problem by saving a state field in a database…

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [12 October 2014 06:10 UTC](https://community.ofelia.com/t/bonita-6-2-api-get-archived-process-instance-by-processinstanceid/5251/3 "2014-10-12T06:10:30Z")

</div>

My first comment -

_I’d like to be able to check on a process instance state to know whether it still need information or if it’s finished (Archived)_

I would add Validators to all necessary fields so that it is not possible to close a case without information…adding information after the fact could be seen as questionable by auditors…

as for the archived versions…try here:

> ArchivedProcessInstance

under

[http://documentation.bonitasoft.com/javadoc/api/6.3/index.html](http://documentation.bonitasoft.com/javadoc/api/6.3/index.html)

You can still use getState

Hope it helps,

regards  
Seán
