use of com.emc.storageos.db.client.model.WorkflowStepData in project coprhd-controller by CoprHD.
the class WorkflowService method getWorkflowStepData.
/**
* Returns a WorkflowStepData from database based on workflowURI and stepId
*
* @param workflowURI -- required workflow URI
* @param stepId -- optional stepId (required); can either be stepId or workflowId
* @param label -- optional label (ignored if not supplied)
* @return WorkflowStepData
*/
private WorkflowStepData getWorkflowStepData(URI workflowURI, String stepId, String label) {
AlternateIdConstraint constraint = AlternateIdConstraint.Factory.getWorkflowStepDataByStep(stepId);
List<WorkflowStepData> dataRecords = CustomQueryUtility.queryActiveResourcesByConstraint(_dbClient, WorkflowStepData.class, constraint);
if (dataRecords == null || dataRecords.isEmpty()) {
_log.info(String.format("data records null or empty for workflow %s and step %s", workflowURI, stepId));
}
for (WorkflowStepData dataRecord : dataRecords) {
if (dataRecord == null || dataRecord.getInactive()) {
_log.info("WorkflowStepData record inactive: " + ((dataRecord != null) ? dataRecord.getId().toString() : stepId));
continue;
}
if (dataRecord.getWorkflowId().equals(workflowURI) && dataRecord.getStepId().equals(stepId)) {
if (label == null && NullColumnValueGetter.isNullValue(dataRecord.getLabel()) || label != null && label.equals(dataRecord.getLabel())) {
return dataRecord;
}
}
}
return null;
}
Aggregations