/*
 * 
 */
package com.fp.bpmlib.query.task;

import com.fp.base.persistence.util.job.ServiceManager;
import com.fp.dto.Response;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;

// TODO: Auto-generated Javadoc
/**
 * Class TaskServerStatus encargada de.
 * 
 * @author gfiallos
 */
public class TaskServerStatus extends QueryRule {

    /** serialVersionUID. */
    private static final long serialVersionUID = 1L;

    /**
     * Process.
     * 
     * @param pQueryRequest the query request
     * @return query request
     * @throws Exception la exception
     */
    @Override
    public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
        Response rs = pQueryRequest.getResponse();
        String code = (String) pQueryRequest.get("code");
        ServiceManager sm = new ServiceManager();

        rs.put("TSStatus", sm.isRunning(code));
        return pQueryRequest;
    }

}
