cancel
Showing results for 
Search instead for 
Did you mean: 

How to get inActive process Definitions using BPM API

Former Member
0 Kudos

Hi Friends,

I am trying to list all the tasks for all the process instances of all process definitions (including active & inactive). I am able to list tasks for active process definition using method processDefManager.getActiveProcessDefinitions(), But I couldn't find a method/api to list tasks waiting under instances of inactive process definitions.

Please let me know if anyone has a direct solution or a workaround.

Thanks

Raags

Accepted Solutions (1)

Accepted Solutions (1)

abdulbasit
Active Contributor
0 Kudos

I had similar requirement, Unfortunately, I couldn't find a way of getting all versions using API.

The only way I found is directly accessing DB. You can use following SQL Statements:

Please keep in mind that this is a workaround, it might not work in your SP level or it might be changed in the future but if there is no other way, it worths to try.

First get DEVCOMPID and OBJECTID using following SQL statement :

select DEVCOMPID, OBJECTID from GLX_RR_DEPL_DELTA where NEWVERSID = 0x{active version id}

Then using these DEVCOMPID and OBJECTID values

select NEWVERSID from GLX_RR_DEPL_DELTA where DEVCOMPID = ...  and OBJECTID = ...

order by HRVERSION desc

You can get all previous versions of a process using active version id.

This is the solution I found using sql traces. You can use this method if someone else will not come up with better solution.

Best,

Abdul.

Former Member
0 Kudos

Thanks Abdul. It looks like i have no other option other going with your workaround.

Thanks Abdul & Christian for the help.

- Raags

abdulbasit
Active Contributor
0 Kudos

By the way, I went to the Idea Place to post this problem but there is already an idea posted today for this requirement. Please add your vote and comment, it would be great to have this method in the API. 

BPM API: Process definition manager: No access to non-active process definitions. : View Idea

Former Member
0 Kudos

Voted. I hope SAP provides it.

Answers (1)

Answers (1)

ch_loos
Advisor
Advisor
0 Kudos

Hi Raags,

Currently the Java API only returns the active version, which can be used for starting a process instance.

What is your use case? Why do you need the inactive versions?

Regards,

Christian

Former Member
0 Kudos

Thanks for your reply, Christian.

Our case is to allow super user to nominate user for tasks which are already reserved/claimed by other users. This happens when a user who claimed a task but left organization then we want to use this application.

So, I am able to get all Processes tasks whose definitions are active. But, in our case there pending tasks for earlier versions of BPM Processes. I want to get their definitions, so that I can show it in the list.

Thanks

Raags

ch_loos
Advisor
Advisor
0 Kudos

If you are looking for the process name to show to the user, you can use ProcessModel:

ProcessModelManager.getProcessModel(processInstance.getModelID()).getName()