@Autowired
private UserRequestDAO userRequestDAO;
private void upgradeActiviti() {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
List<Map<String, Object>> byteArrays =
jdbcTemplate.queryForList("SELECT ID_, BYTES_ FROM ACT_GE_BYTEARRAY");
for (Map<String, Object> row : byteArrays) {
byte[] updated = new String((byte[]) row.get("BYTES_")).replaceAll(
"org\\.apache.syncope\\.core\\.workflow\\.activiti\\.",
"org.apache.syncope.core.workflow.user.activiti.task.").
replaceAll("org\\.apache\\.syncope\\.client\\.to\\.",
"org.apache.syncope.common.to").
replaceAll("org\\.apache\\.syncope\\.types\\.",
"org.apache.syncope.common.types").
replaceAll("org/apache/syncope/types/",
"org/apache/syncope/common/types/").
getBytes();
jdbcTemplate.update("UPDATE ACT_GE_BYTEARRAY SET BYTES_=? WHERE ID_=?",
new Object[] {updated, row.get("ID_")});
}
}