cancel
Showing results for 
Search instead for 
Did you mean: 

ACT_RE_PROCDEF and ACT_GE_BYTEARRAY relationships

bwd
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to get the BPMN XML definition for a given version from the database and associate it with running workflow processes.  The BPMN data appears to be stored in the ACT_GE_BYTEARRAY table (in the BYTES_ column).  The version information appears to be stored in the ACT_RE_PROCDEF (ID_ column), and I can use this to query for active workflows against the ACT_RU_EXECUTION table (column PROC_DEF_ID_) to see what workflows are active against a particular BPMN version.  However, once I have this, I can't find a way to tie it back to the BPMN definition in the bytearray table, as this table doesn't appear to store the version information.  Is there a SQL query or API that call or calls that I can do to obtain this link?

I see that both tables seem to have the same count of rows for a given NAME_/RESOURCE_NAME_, so it looks like entries are created in both tables when I load a new version of a given BPMN.  I suppose I could associate them by ordering the ids and picking one row from each table at the same index, but that seems clunk.

Any help/insight would be appreciated.

bwd
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Hi,

Why don't you use the Activiti API for this?

Best regards,

bwd
Champ in-the-making
Champ in-the-making
Using the API would be my preference - and I see how to obtain the desired information for the current version of a deployed BPMN using method on the RepositoryService.

However, I also need information about prior versions of a given BPMN - both the XML definition as well as the key that I can then use to look up active processes - in order to provide dependency analysis support.  I can't find APIs for this on either the RepositoryService or the HistoryService, which was why I was looking at the database tables directly.

Are there APIs supporting this that don't require that I iterate over all active processes?

Thanks,

bwd.

bwd
Champ in-the-making
Champ in-the-making
It looks like you can associate ACT_GE_BYTEARRAY rows to ACT_RE_PROCDEF rows by mapping (NAME, DEPLOYMENT_ID_) to (RESOURCE_NAME_, DEPLOYMENT_ID_).

Looks like I have to use SQL to get the bytearray data, and then use the RepositoryService.createProcessDefinitionQuery() query to obtain the associated process definition.

(Don't see an API to get the bytearray data.)

bwd