import com.groupstp.cifra.entity.*;
import com.groupstp.workflowstp.entity.*;
import com.haulmont.cuba.core.global.*;
import com.groupstp.workflowstp.service.WorkflowService;
task = workflowInstanceTask;
WorkflowService service = AppBeans.get(WorkflowService.NAME);
try {
String direction = Direction.Income.equals(entity.getDirection()) ? "doc_flow_incoming" : "doc_flow_outgoing"
service.finishTask(task, [(Direction.Income.equals(entity.getDirection()) ? "doc_flow_incoming" : "doc_flow_outgoing"):"true"]);
} catch (Exception e) {
throw new RuntimeException("Ошибка обработки заявки", e);
}
return false;
////////////////////////////////////////////////////////////
verification
import com.groupstp.cifra.entity.*;
import com.groupstp.workflowstp.entity.*;
import com.haulmont.cuba.core.global.*;
import com.groupstp.workflowstp.service.WorkflowService;
task = workflowInstanceTask;
WorkflowService service = AppBeans.get(WorkflowService.NAME);
HashMap<String, String> params = new HashMap<>();
try {
params.put("verification","true");
workflowService.finishTask(task, params);
} catch (Exception e) {
throw new RuntimeException("Ошибка обработки заявки", e);
}
return true;
///////////////////////////////////////////////////////
process
import com.groupstp.cifra.entity.*;
import com.groupstp.workflowstp.entity.*;
import com.haulmont.cuba.core.global.*;
import com.groupstp.workflowstp.service.WorkflowService;
import com.groupstp.cifra.service.workflow.stage.ListStageService;
task = workflowInstanceTask;
WorkflowService service = AppBeans.get(WorkflowService.NAME);
ListStageService listStageService = AppBeans.get(ListStageService.NAME);
HashMap<String, String> params = new HashMap<>();
LinkedHashMap<String, String> stageLink = new LinkedHashMap<>();
try {
stageLink = listStageService.getLinkStage(entity);
params.put(stageLink.entrySet().iterator().next().getKey(), "true");
String direction = Direction.Income.equals(entity.getDirection()) ? "doc_flow_incoming" : "doc_flow_outgoing";
params.put(direction,"true");
service.finishTask(task, params);
} catch (Exception e) {
throw new RuntimeException("Ошибка обработки заявки", e);
}
return true;