long time = System.currentTimeMillis();
//update search indexes
ProcessInstanceSearchData searchData = new ProcessInstanceSearchData(processInstance.getId());
//put some default search attributes
if (creator != null) {
searchData.addSearchAttribute(new ProcessInstanceSearchAttribute("creator_login", creator.getLogin()));
searchData.addSearchAttribute(new ProcessInstanceSearchAttribute("creator_email", creator.getEmail()));
searchData.addSearchAttribute(new ProcessInstanceSearchAttribute("creator_realname", creator.getRealName()));
}
searchData.addSearchAttributes(new String[][]{
{"instance_key", processInstance.getExternalKey()},
{"definition_name", processInstance.getDefinitionName()},
{"instance_description", processInstance.getDescription()},