* @see com.opensymphony.workflow.FunctionProvider#execute(java.util.Map, java.util.Map, com.opensymphony.module.propertyset.PropertySet)
*/
public void execute(Map transientVars, Map args, PropertySet ps)
throws WorkflowException {
MutableIssue mIssue = (MutableIssue) transientVars.get("issue");
ComponentManager componentManager = ComponentManager.getInstance();
final CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
final CustomField dateResolved = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.DATE_RESOLVED);
final CustomField dateResponded = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.DATE_RESPONDED);
final CustomField slaLastCalculated = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.SLA_LAST_CALCULATED);
final CustomField responseSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.RESPONSE_SLA_STATE);
final CustomField fixSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.FIX_KPI_STATE);
final CustomField timeElapsed = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.TIME_ELAPSED);
final CustomField onHold = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.ON_HOLD);
final Project project = mIssue.getProjectObject();
final GenericValue securityLevel = mIssue.getSecurityLevel();
final ClientSLAConfig clientSLAConfiguration = SLAServiceJob.getClientSLAConfiguration(securityLevel.getString("name"), project.getName());
if (clientSLAConfiguration != null)
{
User user;
try {
user = UserUtils.getUser(SLAServiceJob.getSLAServiceUserName());
} catch (EntityNotFoundException e) {
e.printStackTrace();
throw new WorkflowException(e.getMessage());
}
SLAServiceJob.updateIssueSLAFields(clientSLAConfiguration, dateResolved, dateResponded,
slaLastCalculated, responseSlaState,
fixSlaState, timeElapsed, onHold, mIssue, user);
}
final Object dateResolvedVal = mIssue.getCustomFieldValue(dateResolved);
dateResolved.updateValue(null, mIssue, new ModifiedValue(dateResolvedVal, new Timestamp(System.currentTimeMillis())), new DefaultIssueChangeHolder());
}