Search in sources :

Example 1 with Parameter

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;
}
Also used : Parameter(org.kuali.kfs.coreservice.api.parameter.Parameter) ParseException(java.text.ParseException) DateTimeService(org.kuali.rice.core.api.datetime.DateTimeService)

Example 2 with Parameter

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;
}
Also used : Parameter(org.kuali.kfs.coreservice.api.parameter.Parameter) ParseException(java.text.ParseException) DateTimeService(org.kuali.rice.core.api.datetime.DateTimeService)

Example 3 with Parameter

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());
}
Also used : ParameterService(org.kuali.kfs.coreservice.framework.parameter.ParameterService) CuPaymentRequestService(edu.cornell.kfs.module.purap.document.service.CuPaymentRequestService) PaymentRequestService(org.kuali.kfs.module.purap.document.service.PaymentRequestService) Parameter(org.kuali.kfs.coreservice.api.parameter.Parameter)

Aggregations

Parameter (org.kuali.kfs.coreservice.api.parameter.Parameter)3 ParseException (java.text.ParseException)2 DateTimeService (org.kuali.rice.core.api.datetime.DateTimeService)2 CuPaymentRequestService (edu.cornell.kfs.module.purap.document.service.CuPaymentRequestService)1 ParameterService (org.kuali.kfs.coreservice.framework.parameter.ParameterService)1 PaymentRequestService (org.kuali.kfs.module.purap.document.service.PaymentRequestService)1