/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package performa.form;

import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.servlets.forms.NavigationFP;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.utils.BusinessException;
import performa.orm.Job;
import performa.orm.types.JobStatus;

/**
 *
 * @author nilu
 */
public class NavigateBetweenStatusFP extends NavigationFP
{
    
    @Override
    public SuccessfulResult processForm(SubmissionDetails submission) throws BusinessException
    {
        HttpServletRequest  request     =   submission.getRequest();
        JobStatus           newStatus   =   (JobStatus) request.getAttribute ("JobStatus");
        
        LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In NavigateBetweenStatusFP navigating to job status : ", newStatus);

        request.getSession().setAttribute("JobStatus", newStatus);
        
        return super.processForm(submission);
    }
}
