MyTetra Share
Делитесь знаниями!
Алгоритм
Время создания: 19.11.2019 01:17
Раздел: INFO - JOB - CUBA - WorkFlow
Запись: wwwlir/Tetra/master/base/1574097444tx2qt8livm/text.html на raw.githubusercontent.com

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;


 
MyTetra Share v.0.65
Яндекс индекс цитирования