use of org.wso2.carbon.bpmn.core.mgt.model.SubstitutesDataModel in project carbon-business-process by wso2.
the class ActivitiDAO method querySubstituteInfoWithoutEnabled.
/**
* Return the list of substitute info based on query parameters except enabled property.
* @param model data model with only required query parameter values. Leave others as null.
* @return List<PaginatedSubstitutesDataModel> Result set of substitute info
*/
public List<SubstitutesDataModel> querySubstituteInfoWithoutEnabled(final PaginatedSubstitutesDataModel model) {
final RowBounds rw = new RowBounds(model.getStart(), model.getSize());
CustomSqlExecution<SubstitutesMapper, List<SubstitutesDataModel>> customSqlExecution = new AbstractCustomSqlExecution<SubstitutesMapper, List<SubstitutesDataModel>>(SubstitutesMapper.class) {
public List<SubstitutesDataModel> execute(SubstitutesMapper substitutesMapper) {
return substitutesMapper.querySubstitutesWithoutEnabled(rw, model);
}
};
return managementService.executeCustomSql(customSqlExecution);
}
use of org.wso2.carbon.bpmn.core.mgt.model.SubstitutesDataModel in project carbon-business-process by wso2.
the class TransitivityResolver method resolveSubstituteForSingleUser.
protected boolean resolveSubstituteForSingleUser(SubstitutesDataModel dataModel, int tenantId) {
if (SubstitutionDataHolder.getInstance().isTransitivityEnabled()) {
subsMap = dao.selectActiveSubstitutesByTenant(tenantId, new Date(System.currentTimeMillis()));
SubstitutesDataModel subDataModel = dao.selectSubstituteInfo(dataModel.getSubstitute(), tenantId);
if (subDataModel != null) {
String newSub = calculateTransitiveSubstitute(dataModel, dataModel.getUser(), dataModel.getSubstitute());
if (BPMNConstants.TRANSITIVE_SUB_UNDEFINED.equals(newSub)) {
return false;
} else {
dao.updateTransitiveSub(dataModel.getUser(), tenantId, newSub);
return true;
}
} else {
dao.updateTransitiveSub(dataModel.getUser(), tenantId, BPMNConstants.TRANSITIVE_SUB_NOT_APPLICABLE);
return true;
}
} else {
// transitivity not enabled. NO issue with transitive properties.
return true;
}
}
Aggregations