Add a variable to ended process instance ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2014 05:18 AM
Hi,
Is there a way of adding a variable to an ended process instance ? Our database is growing and we want to filter all historic process instance with more values using HistoryService…
I tried with a sql query but i can't find the value for the primary key.
Best regards.
Is there a way of adding a variable to an ended process instance ? Our database is growing and we want to filter all historic process instance with more values using HistoryService…
I tried with a sql query but i can't find the value for the primary key.
Best regards.
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2014 10:04 AM
It's not supported via the Activiti API. But you can add new entries to the historic variable table for example. You can query for historic process instances to retrieve the database id (primary key).
Best regards,
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2014 12:24 PM
Thanks.
But my query would be like this : "INSERT INTO ACT_HI_VARINST VALUES (?, ?, ?…" and the primary key seems to be calculated with a specific algorithm (IdGenerator)…
How can i find the next id to insert ?
Regards.
But my query would be like this : "INSERT INTO ACT_HI_VARINST VALUES (?, ?, ?…" and the primary key seems to be calculated with a specific algorithm (IdGenerator)…
How can i find the next id to insert ?
Regards.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2014 01:26 AM
Hi,
call
org.activiti.engine.impl.cfg.IdGenerator#getNextId
You obtain free id, you can use it for your HI row.
Regards
Martin
call
org.activiti.engine.impl.cfg.IdGenerator#getNextId
You obtain free id, you can use it for your HI row.
Regards
Martin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2014 04:15 AM
Hi,
Thanks for you support.
Just one last question : the getNextId() method of the IdGenerator class uses a property "idBlockSize", how can i find its default value ?
Best regards.
Thanks for you support.
Just one last question : the getNextId() method of the IdGenerator class uses a property "idBlockSize", how can i find its default value ?
Best regards.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2014 12:51 AM
Hi Christophe,
Regards
Martin
public IdBlock execute(CommandContext commandContext) {
PropertyEntity property = (PropertyEntity) commandContext
.getPropertyEntityManager()
.findPropertyById("next.dbid");
long oldValue = Long.parseLong(property.getValue());
long newValue = oldValue+idBlockSize;
property.setValue(Long.toString(newValue));
return new IdBlock(oldValue, newValue-1);
}
Regards
Martin
