cancel
Showing results for 
Search instead for 
Did you mean: 

How large can a Process Variable be

jjfutt
Champ in-the-making
Champ in-the-making
In our java code, we pass a map of key,value pairs as process variables to the process we want to create. In our previous tests, we were using MySQL database and didn't have any problems with setting any variables.

However, the same application, when moved to Oracle Database, started complaining about variables (type String) that were greater than 2k Characters. So my question is:

(i ) How large a String variable can be for Activiti Processes?
(ii ) Are there any size constraints for Serializable Java Classes used as process variables as well that we need to watch out for?


Thanks.
3 REPLIES 3

heymjo
Champ on-the-rise
Champ on-the-rise
ACT_RU_VARIABLE is created like this in Oracle

create table ACT_RU_VARIABLE (
    ID_ NVARCHAR2(64) not null,
    REV_ INTEGER,
    TYPE_ NVARCHAR2(255) not null,
    NAME_ NVARCHAR2(255) not null,
    EXECUTION_ID_ NVARCHAR2(64),
    PROC_INST_ID_ NVARCHAR2(64),
    TASK_ID_ NVARCHAR2(64),
    BYTEARRAY_ID_ NVARCHAR2(64),
    DOUBLE_ NUMBER(*,10),
    LONG_ NUMBER(19,0),
    TEXT_ NVARCHAR2(2000),
    TEXT2_ NVARCHAR2(2000),
    primary key (ID_)
);

and like this in mysql

create table ACT_RU_VARIABLE (
    ID_ varchar(64) not null,
    REV_ integer,
    TYPE_ varchar(255) not null,
    NAME_ varchar(255) not null,
    EXECUTION_ID_ varchar(64),
    PROC_INST_ID_ varchar(64),
    TASK_ID_ varchar(64),
    BYTEARRAY_ID_ varchar(64),
    DOUBLE_ double,
    LONG_ bigint,
    TEXT_ varchar(4000),
    TEXT2_ varchar(4000),
    primary key (ID_)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;

So in Oracle we have nvarchar2(2000) length for TEXT_ and TEXT2_, in mysql it's 4000. I don't see a reason why you couldn't alter the table in oracle and set it to 4000 as well.  As to why Activit uses NVARCHAR2 instead of just VARCHAR2 i have no idea, it does not seem necessary.

I would have thought process vars are stored in blob columns but a quick look at the ddl scripts seems to indicate otherwise, maybe one of the devs knows this better.

HTH

jjfutt
Champ in-the-making
Champ in-the-making
Thank you for your response heymjo.

I indeed thought the variables would have been saved as Blobs. They do have a 'byte array' reference column which then references the byteArray table. So I wonder if that is used for objects. Hopefully one of the developers can answer this?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Yes, other serializable objects go into the bytearray table.