cancel
Showing results for 
Search instead for 
Did you mean: 

Access value of process variable in the database

caiw
Champ in-the-making
Champ in-the-making
Hi,

I'm using BIRT to create reports to show information from a couple of Activiti processes. I'd like to access the value of a process variable that is set in a script task in one of my Activiti processes, but when I look for the variable in the database table "ACT_RU_VARIABLE" the row looks like this (I removed the columns that are empty):

ID_     REV_    TYPE_   NAME_   EXECUTION_ID_   PROC_INST_ID_  BYTEARRAY_ID_  
14188   1       serializable    employmentType  14089   14089           14187

Where is the value of employmentType stored? The TEXT_ column is empty, all there is is the BYTEARRAY_ID_, but where does that ID point to? I've searched the database but haven't been able to figure out where the value is found..

Thanks,
caiw
6 REPLIES 6

mitziuro
Champ in-the-making
Champ in-the-making
Actually the create for ACT_RU_VARIABLE is:


create table ACT_RU_VARIABLE (
    ID_ nvarchar(64) not null,
    REV_ int,
    TYPE_ nvarchar(255) not null,
    NAME_ nvarchar(255) not null,
    EXECUTION_ID_ nvarchar(64),
    PROC_INST_ID_ nvarchar(64),
    TASK_ID_ nvarchar(64),
    BYTEARRAY_ID_ nvarchar(64),
    DOUBLE_ double precision,
    LONG_ numeric(19,0),
    TEXT_ nvarchar(4000),
    TEXT2_ nvarchar(4000),
    primary key (ID_)
);


You'll have to look at LONG_ and TEXT_ columns

caiw
Champ in-the-making
Champ in-the-making
They are both empty, that's why I removed them from my excerpt, as I wrote.

mitziuro
Champ in-the-making
Champ in-the-making
…like this (I removed the columns that are empty):

It means that value it's the empty string or you don't save the correct value .

caiw
Champ in-the-making
Champ in-the-making
No, I don't think so, because the process works like it's supposed to (I use the process variables in conditions to direct the process flow) and I can se that the value is set correctly when I look at the process instance in the Activiti Explorer.

It's just in the database I can't find the value. It's the same with other process variables, they look the same in the database, with TYPE_ serializable and empty TEXT_ column but a value in BYTEARRAY_ID_.

mitziuro
Champ in-the-making
Champ in-the-making
Look in ACT_GE_BYTEARRAY at the 14187 entry. It's serialized in the BYTES_ field.

caiw
Champ in-the-making
Champ in-the-making
Then I get this:

ID_     REV_    NAME_   DEPLOYMENT_ID_  BYTES_  GENERATED_
14187   1                       FFFFFFAC FFFFFFED 0 5 74 0 13 74 …

I don't really know what to do with this..