Package org.drools.workbench.common.services.rest

Examples of org.drools.workbench.common.services.rest.JobResultManager


        JobRequest request = getJobRequest(ctx);
        JobResult result = approvalService.requestApproval(request);
      
        // save job
        logger.debug( "--- job {} ---, status: {}",  result.getJobId(), result.getStatus());
        JobResultManager jobMgr = getJobManager(ctx);
        result.setLastModified(System.currentTimeMillis());
        jobMgr.putJob(result);
      
        // if approved, process
        if( JobStatus.APPROVED.equals(result.getStatus()) ) {
            try {
                result = internalExecute(ctx, request);
            } catch( Exception e ) {
                result.setStatus(JobStatus.SERVER_ERROR);
                result.setResult("Request failed because of " + e.getClass().getSimpleName() + ": " + e.getMessage());
                logger.error("{} [{}] failed because of thrown {}: {}",
                        request.getClass().getSimpleName(), request.getJobId(),
                        e.getClass().getSimpleName(), e.getMessage(), e);
            }

            // save job
            logger.debug( "--- job {} ---, status: {}",  result.getJobId(), result.getStatus());
            result.setLastModified(System.currentTimeMillis());
            jobMgr.putJob(result);
        }
           
        return getEmptyResult();
    }
View Full Code Here

TOP

Related Classes of org.drools.workbench.common.services.rest.JobResultManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.