46 lines
1.1 KiB
Plaintext
Executable File
46 lines
1.1 KiB
Plaintext
Executable File
/*
|
|
*
|
|
*/
|
|
package com.fp.bpmlib.query.task;
|
|
|
|
import com.fp.bpmlib.BPMException;
|
|
import com.fp.bpmlib.task.client.TaskUtil;
|
|
import com.fp.common.helper.BeanManager;
|
|
import com.fp.dto.query.QueryRequest;
|
|
import com.fp.dto.rules.QueryRule;
|
|
|
|
// TODO: Auto-generated Javadoc
|
|
/**
|
|
* Class ClaimTask encargada de.
|
|
*
|
|
* @author gfiallos
|
|
*/
|
|
public class ClaimTask 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 {
|
|
Long tid = BeanManager.convertObject(pQueryRequest.get("TID"), Long.class);
|
|
if (tid == null) {
|
|
throw new BPMException("BPM-0008", "NO SE HA ENCONTRADO LA TAREA {0}", tid);
|
|
}
|
|
TaskUtil t = new TaskUtil(tid);
|
|
try {
|
|
t.claim(pQueryRequest.getUser());
|
|
} finally {
|
|
t.close();
|
|
}
|
|
return pQueryRequest;
|
|
}
|
|
|
|
}
|