*/
public class ProcessPersistentStateMap implements BusinessRulesScript{
public Object execute(Object parameter, SqlCommand sqlCommand,ProcessEngineConfigurationImpl processEngineConfiguration) {
Map<String,Object> mapPersistentState = new HashMap<String, Object>();
ProcessInstanceEntity processInstance = (ProcessInstanceEntity)parameter;
mapPersistentState.put("processInstanceId", processInstance.getId());
mapPersistentState.put("subject", processInstance.getSubject());
mapPersistentState.put("processDefinitionKey", processInstance.getProcessDefinitionKey());
mapPersistentState.put("processDefinitionId", processInstance.getProcessDefinitionId());
mapPersistentState.put("rootTokenId", processInstance.getRootTokenId());
mapPersistentState.put("definitionId", processInstance.getDefinitionId());
mapPersistentState.put("parentProcessInstanceId", processInstance.getParentProcessInstanceId());
mapPersistentState.put("parentProcessInstanceTokenId", processInstance.getParentProcessInstanceTokenId());
mapPersistentState.put("initiator", processInstance.getInitiator());
mapPersistentState.put("startAuthor", processInstance.getStartAuthor());
mapPersistentState.put("bizKey", processInstance.getBizKey());
mapPersistentState.put("startTime", processInstance.getStartTime());
mapPersistentState.put("endTime", processInstance.getEndTime());
mapPersistentState.put("updateTime", processInstance.getUpdateTime());
mapPersistentState.put("archiveTime", processInstance.getArchiveTime());
mapPersistentState.put("isSuspended", processInstance.isSuspended());
mapPersistentState.put("processLocation", processInstance.getProcessLocation());
mapPersistentState.put("instanceStatus", processInstance.getInstanceType());
Map<String,Object> persistenceExtensionFields=processInstance.getPersistenceExtensionFields();
for (String key : persistenceExtensionFields.keySet()) {
mapPersistentState.put(key, persistenceExtensionFields.get(key));
}
return mapPersistentState;
}