use of org.kuali.kfs.coreservice.api.parameter.Parameter in project cu-kfs by CU-CommunityApps.
the class AwardStep method execute.
public boolean execute(String arg0, java.util.Date arg1) throws InterruptedException {
String dateString = parameterService.getParameterValueAsString(PARAMETER_NAMESPACE_CODE, PARAMETER_NAMESPACE_STEP, LAST_SUCCESSFUL_RUN);
LOG.info("AwardStep last successful run parm value= " + dateString);
DateTimeService dtService = SpringContext.getBean(DateTimeService.class);
java.sql.Date lastRun = null;
if (dateString != null) {
try {
lastRun = dtService.convertToSqlDate(dateString);
} catch (ParseException e1) {
e1.printStackTrace();
}
}
boolean result = ezraService.updateAwardsSince(lastRun);
if (result) {
Parameter parm = parameterService.getParameter(PARAMETER_NAMESPACE_CODE, PARAMETER_NAMESPACE_STEP, LAST_SUCCESSFUL_RUN);
Parameter.Builder newParm = Parameter.Builder.create(parm);
newParm.setValue(dtService.toDateTimeString(dtService.getCurrentSqlDate()));
parameterService.updateParameter(newParm.build());
// //parameterService.
}
return result;
}
use of org.kuali.kfs.coreservice.api.parameter.Parameter in project cu-kfs by CU-CommunityApps.
the class AgencyStep method execute.
public boolean execute(String arg0, java.util.Date arg1) throws InterruptedException {
String dateString = parameterService.getParameterValueAsString(AgencyStep.class, LAST_SUCCESSFUL_RUN);
DateTimeService dtService = SpringContext.getBean(DateTimeService.class);
java.sql.Date lastRun = null;
try {
lastRun = dtService.convertToSqlDate(dateString);
} catch (ParseException e1) {
e1.printStackTrace();
}
boolean result = true;
// try {
result = ezraService.updateSponsorsSince(lastRun);
// }
if (result) {
Parameter parm = parameterService.getParameter(PARAMETER_NAMESPACE_CODE, PARAMETER_NAMESPACE_STEP, LAST_SUCCESSFUL_RUN);
Parameter.Builder newParm = Parameter.Builder.create(parm);
newParm.setValue(dtService.toDateTimeString(dtService.getCurrentSqlDate()));
parameterService.updateParameter(newParm.build());
// //parameterService.
}
return result;
}
use of org.kuali.kfs.coreservice.api.parameter.Parameter in project cu-kfs by CU-CommunityApps.
the class CuPaymentRequestServiceImplTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
paymentRequestService = SpringContext.getBean(PaymentRequestService.class);
// Override auto-approval-limit parameter for the duration of the test. The old value will be restored by the post-test rollback.
// NOTE: If this test class ever gets configured to not roll back, then this override should change accordingly to restore the old param value.
ParameterService parameterService = SpringContext.getBean(ParameterService.class);
Parameter oldAmountLimit = parameterService.getParameter(PaymentRequestDocument.class, CUPurapParameterConstants.DEFAULT_PURCHASE_ORDER_POS_APRVL_LMT_FOR_PREQ);
Parameter.Builder newAmountLimit = Parameter.Builder.create(oldAmountLimit);
newAmountLimit.setValue(RequisitionItemFixture.REQ_QTY_ITEM_AMOUNT_AT_5K.extendedPrice.toString());
parameterService.updateParameter(newAmountLimit.build());
}
Aggregations