package com.vci.server.workflow.server.delegate;
|
|
import java.io.IOException;
|
import java.io.UnsupportedEncodingException;
|
import java.math.BigDecimal;
|
import java.sql.SQLException;
|
import java.util.ArrayList;
|
import java.util.Date;
|
import java.util.HashMap;
|
import java.util.LinkedList;
|
import java.util.List;
|
import java.util.Map;
|
|
import org.jbpm.api.ProcessDefinition;
|
import org.jbpm.api.task.Task;
|
import org.omg.CORBA.LongHolder;
|
|
import com.vci.common.log.ServerWithLog4j;
|
import com.vci.common.objects.QueryParam;
|
import com.vci.common.objects.QueryResult;
|
import com.vci.common.utility.ObjectUtility;
|
import com.vci.corba.common.VCIError;
|
import com.vci.corba.workflow.data.QueryParamInfo;
|
import com.vci.corba.common.data.UserEntityInfo;
|
import com.vci.corba.workflow.data.FlowApproveHistoryInfo;
|
import com.vci.corba.workflow.data.FlowInstanceInfo;
|
import com.vci.corba.workflow.data.FlowObjectInfo;
|
import com.vci.corba.workflow.data.FlowTaskInfo;
|
import com.vci.corba.workflow.data.MapTransfersInfo;
|
import com.vci.corba.workflow.data.NodeHideInfo;
|
import com.vci.corba.workflow.data.ProcessCategoryInfo;
|
import com.vci.corba.workflow.data.ProcessDefinitionInfo;
|
import com.vci.corba.workflow.data.ProcessTaskInfo;
|
import com.vci.corba.workflow.data.SubprocessTemInfo;
|
import com.vci.corba.workflow.data.TaskDescInfo;
|
import com.vci.corba.workflow.data.TaskRevokeInfo;
|
import com.vci.corba.workflow.data.TasksAssignedInfo;
|
import com.vci.server.workflow.common.task.FlowApproveHistory;
|
import com.vci.server.workflow.objects.NodeHide;
|
import com.vci.server.workflow.objects.PLFlowObject;
|
import com.vci.server.workflow.objects.ProcessCategory;
|
import com.vci.server.workflow.objects.ProcessTask;
|
import com.vci.server.workflow.objects.TaskDescSObject;
|
import com.vci.server.workflow.objects.TaskRevokeSObject;
|
import com.vci.server.workflow.server.template.ProcessCustomService;
|
import com.vci.server.workflow.server.template.ProcessTemplateService;
|
import com.vci.server.workflow.server.template.TasksAssigned;
|
|
public class ProcessCustomDelegate extends BaseDelegate {
|
ProcessCustomService service = null;
|
public ProcessCustomDelegate(UserEntityInfo userEntityInfo) {
|
super(userEntityInfo);
|
service = new ProcessCustomService(this.getUserEntity());
|
}
|
|
public ProcessCustomDelegate() {
|
service = new ProcessCustomService();
|
}
|
|
public ProcessCategoryInfo[] getProcessCategories(String parentId) throws VCIError {
|
ProcessCategoryInfo[] infos = new ProcessCategoryInfo[0];
|
try {
|
List<ProcessCategory> list = service.getProcessCategories(parentId);
|
ProcessCategory[] objects = list.toArray(new ProcessCategory[] {});
|
infos = this.convertProcessCategorysToProcessCategoryInfos(objects);
|
} catch (Exception ex) {
|
throw new VCIError("410101", new String[] {});
|
}
|
return infos;
|
}
|
public ProcessCategoryInfo[] getProcessCategoriesByPage(String parentId,int pageSize,int pageIndex) throws VCIError {
|
ProcessCategoryInfo[] infos = new ProcessCategoryInfo[0];
|
try {
|
List<ProcessCategory> list = service.getProcessCategoriesByPage(parentId,pageSize,pageIndex);
|
ProcessCategory[] objects = list.toArray(new ProcessCategory[] {});
|
infos = this.convertProcessCategorysToProcessCategoryInfos(objects);
|
} catch (Exception ex) {
|
throw new VCIError("410101", new String[] {});
|
}
|
return infos;
|
}
|
public String saveProcessCategory(ProcessCategoryInfo info) throws VCIError {
|
String id = ObjectUtility.getNewObjectID36();
|
info.id = id;
|
try {
|
service.saveProcessCategory(this.convertProcessCategoryInfoToProcessCategory(info));
|
} catch (Exception ex) {
|
throw new VCIError("410102", new String[] {});
|
}
|
return id;
|
}
|
|
public boolean updateProcessCategory(ProcessCategoryInfo info) throws VCIError {
|
boolean res = false;
|
try {
|
res = service.updateProcessCategory(this.convertProcessCategoryInfoToProcessCategory(info));
|
} catch (Exception ex) {
|
throw new VCIError("410103", new String[] {});
|
}
|
return res;
|
}
|
|
public boolean existProcessCategory(String id, String name) throws VCIError {
|
boolean result = false;
|
try {
|
result = service.existProcessCategory(id, name);
|
} catch (Exception ex) {
|
throw new VCIError("410104", new String[] {});
|
}
|
return result;
|
}
|
|
public boolean deleteProcessCategory(String id) throws VCIError {
|
boolean res = false;
|
try {
|
res = service.deleteProcessCategory(id);
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410105", new String[] {});
|
}
|
return res;
|
}
|
|
/**
|
* 移动流程模板
|
* @param deploymentId
|
* @param categoryId
|
* @return
|
* @throws VCIError
|
*/
|
public boolean moveDefinition( String deploymentId , String categoryId) throws VCIError{
|
return service.moveDefinition(deploymentId, categoryId);
|
}
|
|
|
public void loadWorkFlowTemplate(String jbpmDeploymentId){
|
new ProcessTemplateService().loadWorkFlowTemplate(jbpmDeploymentId);
|
}
|
|
public boolean deployProcess(byte[] jbpmImage, String jbmpXml, String graphXml, String processCategoryId, ProcessTaskInfo[] processTaskInfos) throws VCIError {
|
boolean res = false;
|
try {
|
res = new ProcessTemplateService(this.getUserEntity()).deployProcess(jbpmImage, jbmpXml, graphXml, processCategoryId, processTaskInfos);
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410106", new String[] {});
|
}
|
return res;
|
}
|
|
public boolean updateProcess(byte[] jbpmImage, String jbmpXml, String graphXml, String processCategoryId, ProcessTaskInfo[] processTaskInfos,String deployId) throws VCIError {
|
boolean res = false;
|
try {
|
res = new ProcessTemplateService(this.getUserEntity()).updateProcess(jbpmImage, jbmpXml, graphXml, processCategoryId, processTaskInfos, deployId);
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410106", new String[] {});
|
}
|
return res;
|
}
|
/**
|
* 通过任务节点获取阶段名称
|
* @param processDefinitionKey
|
* @param jbpmdeploymentid
|
* @return
|
* @throws VCIError
|
*/
|
public String getTaskPhaseName(String processDefinitionKey,
|
String jbpmdeploymentid,FlowInstanceInfo var) throws VCIError {
|
try{
|
return new ProcessTemplateService(this.getUserEntity()).getTaskPhaseName(processDefinitionKey, jbpmdeploymentid,var);
|
}catch(Error e){
|
throw e;
|
}
|
}
|
public boolean deleteProcessDefinition(String deployId, String pdId) throws VCIError {
|
boolean res = false;
|
try {
|
res = service.deleteProcessDefinition(deployId, pdId);
|
} catch (VCIError ex) {
|
ex.printStackTrace();
|
throw ex;
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410112", new String[] {});
|
}
|
return res;
|
}
|
|
public ProcessDefinitionInfo[] getProcessDefinitions(String processCategoryId) throws VCIError {
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinitionInfo> processDefinitions = new ProcessTemplateService().getProcessDefinitions(processCategoryId);
|
infos = processDefinitions.toArray(new ProcessDefinitionInfo[] {});
|
} catch (Exception ex) {
|
throw new VCIError("410107", new String[] {});
|
}
|
return infos;
|
}
|
public ProcessDefinitionInfo[] getAllProcessDefinitions() throws VCIError {
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinitionInfo> processDefinitions = new ProcessTemplateService().getAllProcessDefinitions();
|
infos = processDefinitions.toArray(new ProcessDefinitionInfo[] {});
|
} catch (Exception ex) {
|
throw new VCIError("410107", new String[] {});
|
}
|
return infos;
|
}
|
/**
|
* 编码专用
|
* @param processCategoryId
|
* @return
|
* @throws VCIError
|
*/
|
public ProcessDefinitionInfo[] getProcessDefinitionsForRMCode(String processCategoryId) throws VCIError {
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinitionInfo> processDefinitions = new ProcessTemplateService().getProcessDefinitionsForRMCode(processCategoryId);
|
infos = processDefinitions.toArray(new ProcessDefinitionInfo[] {});
|
} catch (Exception ex) {
|
throw new VCIError("410107", new String[] {});
|
}
|
return infos;
|
}
|
public ProcessDefinitionInfo[] getProcessDefinitionsByPage(String processCategoryId,String name, int pageSize, int pageIndex) throws VCIError {
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinitionInfo> processDefinitions = new ProcessTemplateService().getProcessDefinitionsByPage(processCategoryId,name, pageSize, pageIndex);
|
infos = processDefinitions.toArray(new ProcessDefinitionInfo[] {});
|
} catch (Exception ex) {
|
throw new VCIError("410107", new String[] {});
|
}
|
return infos;
|
}
|
public ProcessDefinitionInfo[] getProcessDefinitionByProcessDefinitionName(String processCategoryName,String processCategoryId) throws VCIError {
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinitionInfo> processDefinitions = new ProcessTemplateService().getProcessDefinitionByProcessDefinitionName(processCategoryName,processCategoryId);
|
infos = processDefinitions.toArray(new ProcessDefinitionInfo[] {});
|
} catch (Exception ex) {
|
throw new VCIError("410107", new String[] {});
|
}
|
return infos;
|
}
|
public ProcessDefinitionInfo getProcessDefinitionByDeployId(String deployId) throws VCIError {
|
ProcessDefinitionInfo info = new ProcessDefinitionInfo();
|
try {
|
info = new ProcessTemplateService().getProcessDefinitionByDeployId(deployId);
|
} catch (Exception ex) {
|
throw new VCIError("410115", new String[] {ex.getCause().getMessage()});
|
}
|
return info;
|
}
|
public byte[] getProcessResource(String jbpmDeploymentId, String resourceType) throws VCIError {
|
byte[] infos = new byte[0];
|
try {
|
infos = new ProcessTemplateService().getProcessResource(jbpmDeploymentId, resourceType);
|
} catch (Exception ex) {
|
throw new VCIError("410108", new String[] {});
|
}
|
return infos;
|
}
|
|
public String[] getNextCandidates(String jbpmDeploymentId, String taskName,
|
String outcome) throws VCIError {
|
String[] infos = new String[0];
|
try {
|
infos = new ProcessTemplateService().getNextCandidates(jbpmDeploymentId, taskName, outcome);
|
} catch (Exception ex) {
|
throw new VCIError("410122", new String[] {});
|
}
|
return infos;
|
}
|
|
/**
|
* 获取下一步任务候选人
|
* @param excutionId
|
* @param taskName
|
* @return
|
*/
|
public String[] nextTaskCandidateUsers(String excutionId,String taskName){
|
String[] infos = new String[0];
|
infos = new ProcessTemplateService().nextTaskCandidateUsers(excutionId, taskName);
|
return infos;
|
}
|
public String[] getNextTaskNames(String jbpmDeploymentId, String taskName,
|
String outcome) throws VCIError {
|
String[] infos = new String[0];
|
try {
|
infos = new ProcessTemplateService().getNextTaskNames(jbpmDeploymentId, taskName, outcome);
|
} catch (Exception ex) {
|
throw new VCIError("410123", new String[] {});
|
}
|
return infos;
|
}
|
public String[] getCurCandidates(String jbpmDeploymentId, String taskName,
|
String outcome, String excutionId) throws VCIError {
|
String[] infos = new String[0];
|
try {
|
infos = new ProcessTemplateService().getCurCandidates(jbpmDeploymentId, taskName, outcome, excutionId);
|
} catch (Exception ex) {
|
throw new VCIError("410124", new String[] {});
|
}
|
return infos;
|
}
|
public String[] getAllCandidatesForTask(String jbpmDeploymentId, String taskName,
|
String outcome) throws VCIError {
|
String[] infos = new String[0];
|
try {
|
infos = new ProcessTemplateService().getAllCandidatesForTask(jbpmDeploymentId, taskName, outcome);
|
} catch (Exception ex) {
|
throw new VCIError("410124", new String[] {});
|
}
|
return infos;
|
}
|
public String[] getCurConstituents(String jbpmDeploymentId, String taskName,
|
String outcome) throws VCIError {
|
String[] infos = new String[0];
|
try {
|
infos = new ProcessTemplateService().getCurConstituents(jbpmDeploymentId, taskName, outcome);
|
} catch (Exception ex) {
|
throw new VCIError("410124", new String[] {});
|
}
|
return infos;
|
}
|
public String[] getTrainName(String jbpmDeploymentId, String taskName,
|
String outcome) throws VCIError {
|
String[] infos = new String[0];
|
try {
|
infos = new ProcessTemplateService().getTrainName(jbpmDeploymentId, taskName, outcome);
|
} catch (Exception ex) {
|
throw new VCIError("410125", new String[] {});
|
}
|
return infos;
|
}
|
|
public ProcessDefinitionInfo[] getProcessDefinition(String rmTemplateId, String processType) throws VCIError {
|
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinition> processDefinitions = new ProcessTemplateService().getProcessDefinition(rmTemplateId, processType);
|
ProcessDefinition[] objects = processDefinitions.toArray(new ProcessDefinition[] {});
|
infos = this.convertProcessDefinitionsToProcessDefinitionInfos(objects);
|
} catch (Exception ex) {
|
throw new VCIError("410109", new String[] {});
|
}
|
return infos;
|
}
|
/**
|
* 获取全部流程定义
|
* @return
|
* @throws VCIError
|
*/
|
public ProcessDefinitionInfo[] getProcessDefinitionAll() throws VCIError {
|
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinition> processDefinitions = new ProcessTemplateService().getProcessDefinitionAll();
|
ProcessDefinition[] objects = processDefinitions.toArray(new ProcessDefinition[] {});
|
infos = this.convertProcessDefinitionsToProcessDefinitionInfos(objects);
|
} catch (Exception ex) {
|
throw new VCIError("410109", new String[] {});
|
}
|
return infos;
|
}
|
|
public void saveRMTemplateProcess(String rmTemplateId, String[] processTypes, String[] jbpmDeploymentIds) throws VCIError {
|
try {
|
|
new ProcessTemplateService().saveRMTemplateProcess(rmTemplateId, processTypes, jbpmDeploymentIds);
|
} catch (Exception ex) {
|
throw new VCIError("410110", new String[] {});
|
}
|
}
|
|
public boolean deleteRMTemplateProcess(String rmTemplateId) throws VCIError {
|
boolean res = false;
|
try {
|
res = new ProcessTemplateService().deleteRMTemplateProcess(rmTemplateId);
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410111", new String[] {});
|
}
|
return res;
|
}
|
|
public FlowInstanceInfo getFlowInstanceInfo(String taskId) throws VCIError {
|
FlowInstanceInfo info = new FlowInstanceInfo();
|
try {
|
info = service.getFlowInstanceInfo(taskId);
|
} catch (Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410115", new String[] {});
|
}
|
return info;
|
}
|
|
public TaskDescInfo[] getTaskDescList(String taskName, String deploymentId){
|
List<TaskDescSObject> list = new ProcessTemplateService().getTaskDescList(taskName, deploymentId);
|
TaskDescInfo[] taskDescinfo = new TaskDescInfo[list.size()];
|
for(int i=0;i<list.size();i++){
|
TaskDescSObject object = list.get(i);
|
taskDescinfo[i] = convertTaskDescObjToInfo(object);
|
}
|
return taskDescinfo;
|
}
|
|
/************************* CORBA & HIBERNATE CONVERT **************************/
|
/**
|
* 对象转换(批量),从Corba对象转换到Hibernate对象
|
*
|
* @param objects
|
*/
|
private TaskDescInfo convertTaskDescObjToInfo(TaskDescSObject o){
|
TaskDescInfo info = new TaskDescInfo();
|
info.id = o.getId() == null ? "" : o.getId();
|
info.pljbpmdeploymentid = o.getPljbpmdeploymentid() == null?"":o.getPljbpmdeploymentid();
|
info.pltask = o.getPltask() ==null?"":o.getPltask();
|
info.pltaskdesc = o.getPltaskdesc() ==null?"":o.getPltaskdesc();
|
info.pltreatment = o.getPltreatment() ;
|
info.popUserDialog = o.getPopUserDialog()==null?"":o.getPopUserDialog();
|
info.customclassname = o.getPlcustomclassname()==null?"":o.getPlcustomclassname();
|
info.customparam = o.getPlcustomparam()==null?"":o.getPlcustomparam();
|
return info;
|
}
|
private ProcessCategoryInfo[] convertProcessCategorysToProcessCategoryInfos(ProcessCategory[] objects) {
|
ProcessCategoryInfo[] infos = new ProcessCategoryInfo[objects.length];
|
int i = 0;
|
for (ProcessCategory obj : objects) {
|
infos[i++] = this.convertProcessCategoryToProcessCategoryInfo(obj);
|
}
|
return infos;
|
}
|
|
private ProcessCategoryInfo convertProcessCategoryToProcessCategoryInfo(ProcessCategory object) {
|
ProcessCategoryInfo info = new ProcessCategoryInfo();
|
info.id = object.getId() == null ? "" : object.getId();
|
info.parentId = object.getId() == null ? "" : object.getParentId();
|
info.name = object.getName() == null ? "" : object.getName();
|
info.desc = object.getDesc() == null ? "" : object.getDesc();
|
info.icon = object.getIcon() == null ? "" : object.getIcon();
|
info.createTime = object.getCreateTime().getTime();
|
info.createUser = object.getCreateUser() == null ? "" : object.getCreateUser();
|
info.createRole = object.getCreateRole() == null ? "" : object.getCreateRole();
|
info.createOrg = object.getCreateOrg() == null ? "" : object.getCreateOrg();
|
info.modifyTime = object.getModifyTime().getTime();
|
info.modifyUser = object.getModifyUser() == null ? "" : object.getModifyUser();
|
info.modifyRole = object.getModifyRole() == null ? "" : object.getModifyRole();
|
info.modifyOrg = object.getModifyOrg() == null ? "" : object.getModifyOrg();
|
return info;
|
}
|
|
private ProcessCategory convertProcessCategoryInfoToProcessCategory(ProcessCategoryInfo info) {
|
ProcessCategory object = new ProcessCategory();
|
object.setId(info.id);
|
object.setParentId(info.parentId);
|
object.setName(info.name);
|
object.setDesc(info.desc);
|
object.setIcon(info.icon);
|
object.setCreateTime(new Date(info.createTime));
|
object.setCreateUser(info.createUser);
|
object.setCreateRole(info.createRole);
|
object.setCreateOrg(info.createOrg);
|
object.setModifyTime(new Date(info.modifyTime));
|
object.setModifyUser(info.modifyUser);
|
object.setModifyRole(info.modifyRole);
|
object.setModifyOrg(info.modifyOrg);
|
return object;
|
}
|
|
private ProcessDefinitionInfo[] convertProcessDefinitionsToProcessDefinitionInfos(ProcessDefinition[] objects) {
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[objects.length];
|
int i = 0;
|
for (ProcessDefinition obj : objects) {
|
infos[i++] = this.convertProcessDefinitionToProcessDefinitionInfo(obj);
|
}
|
return infos;
|
}
|
|
private ProcessDefinitionInfo convertProcessDefinitionToProcessDefinitionInfo(ProcessDefinition object) {
|
ProcessDefinitionInfo info = new ProcessDefinitionInfo();
|
info.id = object.getId() == null ? "" : object.getId();
|
info.name = object.getName() == null ? "" : object.getName();
|
info.key = object.getKey() == null ? "" : object.getKey();
|
info.version = object.getVersion();
|
info.jbpmDeploymentId = object.getDeploymentId() == null ? "" : object.getDeploymentId();
|
return info;
|
}
|
|
public boolean startProcessInstanceByKey(String processDefinitionKey, FlowInstanceInfo var, String[] objId,String[] userName,String outcome) throws VCIError{
|
try{
|
return new ProcessTemplateService(this.getUserEntity()).startProcessInstanceByKey(processDefinitionKey, var, objId,userName,outcome);
|
}catch(VCIError e){
|
e.printStackTrace();
|
throw e;
|
}
|
}
|
// public boolean startProcessInstanceByKey(String processDefinitionKey, FlowInstanceInfo var, String[] objId,String[] userNames) throws VCIError{
|
// try{
|
// return new ProcessTemplateService(this.getUserEntity()).startProcessInstanceByKey(processDefinitionKey, var, objId,userNames);
|
// }catch(Error e){
|
// throw e;
|
// }
|
// }
|
|
public String startPocessSetUser(String processDefinitionKey,
|
FlowInstanceInfo flowInstanceInfo, String[] objId,
|
UserEntityInfo userEntityInfo, String[] userName, String outcome,
|
String[] tasknames, String[][] taskUserNames) throws VCIError{
|
Map<String,String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for(int i=0;i<tasknames.length;i++){
|
taskAndUserMap.put(tasknames[i], taskUserNames[i]);
|
}
|
return new ProcessTemplateService(this.getUserEntity()).startPocessSetUser(processDefinitionKey, flowInstanceInfo, objId, userName, outcome, taskAndUserMap);
|
}
|
public String startPocessSetUser(String processDefinitionKey,
|
FlowInstanceInfo flowInstanceInfo, String[] objId,
|
UserEntityInfo userEntityInfo, String[] userName, String outcome,
|
String[] tasknames, String[][] taskUserNames,String[] keys,String[] values) throws VCIError{
|
Map<String,String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for(int i=0;i<tasknames.length;i++){
|
taskAndUserMap.put(tasknames[i], taskUserNames[i]);
|
}
|
return new ProcessTemplateService(this.getUserEntity()).startPocessSetUser(processDefinitionKey, flowInstanceInfo, objId, userName, outcome, taskAndUserMap,keys,values);
|
}
|
public String startPocessByPLM(String processDefinitionKey,
|
FlowInstanceInfo flowInstanceInfo, String[] objId,
|
UserEntityInfo userEntityInfo, String[] userName, String outcome,
|
String[] tasknames, String[][] taskUserNames,MapTransfersInfo[] mapTransfersServerObject) throws VCIError{
|
Map<String,String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for(int i=0;i<tasknames.length;i++){
|
taskAndUserMap.put(tasknames[i], taskUserNames[i]);
|
}
|
Map<String,Object> mapParams = new HashMap<String, Object>();
|
for(int i=0;i<mapTransfersServerObject.length;i++){
|
mapParams.put(mapTransfersServerObject[i].key, mapTransfersServerObject[i].value);
|
}
|
return new ProcessTemplateService(this.getUserEntity()).startPocessByPLM(processDefinitionKey, flowInstanceInfo, objId, userName, outcome, taskAndUserMap, mapParams);
|
}
|
|
public void setTaskAndUserForComplete(String executionId,String[] tasknames,String[][] taskUserNames){
|
Map<String,String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for(int i=0;i<tasknames.length;i++){
|
taskAndUserMap.put(tasknames[i], taskUserNames[i]);
|
}
|
new ProcessTemplateService(this.getUserEntity()).setTaskAndUserForComplete(executionId,taskAndUserMap);
|
}
|
// public boolean startProcessInstanceByKeyForWuyuan(String processDefinitionKey, FlowInstanceInfo var, String[] objId,String[] userName,String outcome) throws VCIError{
|
// try{
|
// return new ProcessTemplateService(this.getUserEntity()).startProcessInstanceByKeyForWuyuan(processDefinitionKey, var, objId,userName,outcome);
|
// }catch(Error e){
|
// throw e;
|
// }
|
// }
|
|
// public FlowTaskInfo[] getTodoTaskByUserId(String pluseroid,int first,int pageSize, String expandSql) {
|
// return new ProcessTemplateService().getTodoTaskByUserId(pluseroid,first,pageSize, expandSql);
|
// }
|
|
/**
|
* 编码资源专用-待办任务
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param taskType
|
* @param sql
|
* @return
|
*/
|
public FlowTaskInfo[] getTodoTaskByUserId(String pluseroid,int first,int pageSize,String taskType,String sql) {
|
return new ProcessTemplateService().getTodoTaskByUserId(pluseroid,first,pageSize,taskType,sql);
|
}
|
/**
|
* 待办任务-可排序
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param taskType
|
* @param sql
|
* @param orderStr
|
* @return
|
*/
|
public FlowTaskInfo[] getTodoTaskCompositorByUserId(String pluseroid,int first,int pageSize,String taskType,String sql,String orderStr) {
|
return new ProcessTemplateService().getTodoTaskCompositorByUserId(pluseroid, first, pageSize, taskType, sql, orderStr);
|
}
|
// public int queryTodoTaskCount(String pluseroid, String expandSql) throws VCIError{
|
// int count = 1;
|
// try{
|
// count = new ProcessTemplateService().queryTodoTaskCount(pluseroid, expandSql);
|
// }catch(Exception ex) {
|
// ex.printStackTrace();
|
// throw new VCIError(410119, new String[] {});
|
// }
|
// return count;
|
// }
|
/**
|
* 编码专用
|
* @param pluseroid
|
* @param expandSql
|
* @return
|
* @throws VCIError
|
*/
|
public int queryTodoTaskCount(String pluseroid, String expandSql) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryTodoTaskCount(pluseroid, expandSql);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410119", new String[] {});
|
}
|
return count;
|
}
|
|
/**
|
* 抄送消息列表
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @return
|
*/
|
public FlowTaskInfo[] getCCTaskByUserId(String pluseroid,int first,int pageSize) {
|
return new ProcessTemplateService().getCCTaskByUserId(pluseroid,first,pageSize);
|
}
|
|
/**
|
* 抄送消息总数
|
* @param pluseroid
|
* @return
|
* @throws VCIError
|
*/
|
public int queryCCTaskCount(String pluseroid) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryCCTaskCount(pluseroid);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410119", new String[] {});
|
}
|
return count;
|
}
|
|
public FlowTaskInfo[] getDoneTaskByUserId(String pluseroid) {
|
// return new ProcessTemplateService().getDoneTaskByUserId(pluseroid);
|
return new FlowTaskInfo[]{};
|
}
|
|
// public FlowTaskInfo[] getTrackTaskByUserId(String pluseroid,int first,int pageSize, String expandSql) {
|
// return new ProcessTemplateService().getTrackTaskByUserId(pluseroid,first,pageSize, expandSql);
|
// }
|
|
/**
|
* 跟踪流程
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param taskType
|
* @param querySQL
|
* @return
|
*/
|
public FlowTaskInfo[] getTrackTaskByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) {
|
return new ProcessTemplateService().getTrackTaskByUserId(pluseroid, first, pageSize, taskType, querySQL);
|
}
|
|
/**
|
* 我发起的流程
|
* 2013-4-9
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @return
|
*/
|
public FlowTaskInfo[] getMyTrackProcessByUserId(String pluseroid,int first,int pageSize, String expandSql) {
|
return new ProcessTemplateService().getMyTrackProcessByUserId(pluseroid,first,pageSize, expandSql);
|
}
|
/**
|
* 我发起的流程-可排序
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param expandSql
|
* @param orderStr
|
* @return
|
*/
|
public FlowTaskInfo[] getMyTrackProcessCompositorByUserId(String pluseroid,int first,int pageSize, String expandSql,String orderStr) {
|
return new ProcessTemplateService().getMyTrackProcessCompositorByUserId(pluseroid, first, pageSize, expandSql, orderStr);
|
}
|
|
/**
|
* 根据数据查询流程示例
|
* @param dataId
|
* @param tableName TODO
|
* @return
|
*/
|
public FlowTaskInfo[] getFlowTaskInfoByDataId(String dataId, String tableName) {
|
return new ProcessTemplateService().getFlowTaskInfoByDataId(dataId, tableName);
|
}
|
/** 根据数据id查询流程实例
|
* @param dataIds
|
* @param tableName
|
* @return
|
*/
|
public String[] getFlowTaskInfoByDataIds(String[] dataIds, String tableName) {
|
return new ProcessTemplateService().getFlowTaskInfoByDataIds(dataIds, tableName);
|
}
|
|
// public int queryTraceTaskCount(String pluseroid, String expandSql) throws VCIError{
|
// int count = 1;
|
// try{
|
// count = new ProcessTemplateService().queryTraceTaskCount(pluseroid, expandSql);
|
// }catch(Exception ex) {
|
// ex.printStackTrace();
|
// throw new VCIError(410118, new String[] {});
|
// }
|
// return count;
|
// }
|
/**
|
* 跟踪流程总数查询
|
* @param pluseroid
|
* @param expandSql
|
* @return
|
* @throws VCIError
|
*/
|
public int queryTraceTaskCount(String pluseroid, String expandSql) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryTraceTaskCount(pluseroid, expandSql);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410118", new String[] {});
|
}
|
return count;
|
}
|
public int queryMyTraceProcessCount(String pluseroid, String expandSql) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryMyTraceProcessCount(pluseroid, expandSql);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410118", new String[] {});
|
}
|
return count;
|
}
|
|
public boolean completeTask(String taskId, String outcome,String nextTask, String approvalNote,String[] userName) throws VCIError {
|
try{
|
return new ProcessTemplateService(this.getUserEntity()).completeTask(taskId, outcome, nextTask,approvalNote,userName);
|
}catch(VCIError e){
|
throw e;
|
}
|
}
|
public boolean completeTask(String taskId, String outcome,String nextTask, String approvalNote,String[] userName,String[] keys,String[] values) throws VCIError {
|
try{
|
return new ProcessTemplateService(this.getUserEntity()).completeTask(taskId, outcome, nextTask,approvalNote,userName,keys,values);
|
}catch(VCIError e){
|
throw e;
|
}
|
}
|
public boolean completeTaskByPlatform(String taskId, String outcome,String nextTask, String approvalNote,String[] userName) throws VCIError {
|
try{
|
return new ProcessTemplateService(this.getUserEntity()).completeTaskByPlatform(taskId, outcome, nextTask,approvalNote,userName);
|
}catch(VCIError e){
|
throw e;
|
}
|
}
|
|
/**
|
* 获取任务的子任务
|
* @param taskId
|
* @return
|
*/
|
public String[] getsubTasks( String taskId){
|
List<Task> getsubTasks = new ProcessTemplateService().getsubTasks(taskId);
|
String[] subTasks = new String[getsubTasks.size()];
|
for(int i=0;i<getsubTasks.size();i++){
|
subTasks[i] = getsubTasks.get(i).getName();
|
}
|
return subTasks;
|
}
|
/**
|
* 编码资源专用-任务提交
|
* @param taskId
|
* @param outcome
|
* @param approvalNote
|
* @param userNames
|
* @throws VCIError
|
*/
|
public void completeTask(String taskId, String outcome, String approvalNote,String[] userNames) throws VCIError {
|
try{
|
new ProcessTemplateService(this.getUserEntity()).completeTask(taskId, outcome, approvalNote, userNames);
|
}catch(Error e){
|
throw e;
|
}
|
}
|
|
public ProcessTaskInfo findTaskPropertyById(String jbpmDeploymentId, String name) {
|
return new ProcessTemplateService().findTaskPropertyById(jbpmDeploymentId, name);
|
}
|
|
public FlowApproveHistoryInfo[] getHistoryActivityByProInsId(String processInstanceId) {
|
List<FlowApproveHistory> list = new ProcessTemplateService().getHistoryActivityByProInsId(processInstanceId);
|
return convListToFlowApproveHistoryInfo(list);
|
|
}
|
|
private FlowApproveHistoryInfo[] convListToFlowApproveHistoryInfo(List<FlowApproveHistory> list) {
|
FlowApproveHistoryInfo[] f = new FlowApproveHistoryInfo[list.size()];
|
|
for (int i = 0; i < list.size(); i++) {
|
FlowApproveHistory flowApproveHistory = list.get(i);
|
f[i] = new FlowApproveHistoryInfo();
|
f[i].taskId = flowApproveHistory.getTaskId() == null?"":flowApproveHistory.getTaskId();
|
f[i].executionId = flowApproveHistory.getExecutionId() == null ? "" : flowApproveHistory.getExecutionId();
|
f[i].taskName = flowApproveHistory.getTaskName() == null ? "" : flowApproveHistory.getTaskName();
|
f[i].opinion = flowApproveHistory.getOpinion() == null ? "" : flowApproveHistory.getOpinion();
|
f[i].assignee = flowApproveHistory.getAssignee() == null ? "" : flowApproveHistory.getAssignee();
|
f[i].createTime = flowApproveHistory.getCreateTime() == null ? 0 : flowApproveHistory.getCreateTime().getTime();
|
f[i].endTime = flowApproveHistory.getEndTime() == null ? 0 : flowApproveHistory.getEndTime().getTime();
|
f[i].note = flowApproveHistory.getNote() == null ? "" : flowApproveHistory.getNote();
|
|
f[i].parentTaskId = flowApproveHistory.getParentTaskId() == null ? "" : flowApproveHistory.getParentTaskId();
|
}
|
return f;
|
}
|
|
public byte[] getExecutionImageByExecutionId(String executionId, String taskName) throws IOException {
|
return new ProcessTemplateService().getExecutionImageByExecutionId(executionId, taskName);
|
}
|
public byte[] getExecutionImage(String executionId) throws IOException {
|
return new ProcessTemplateService().getExecutionImage(executionId);
|
}
|
|
public FlowObjectInfo[] getFlowObjectByExecutionId(String executionId) {
|
List<PLFlowObject> list = new ProcessTemplateService().getFlowObjectByExecutionId(executionId);
|
return convListToInfo(list);
|
}
|
|
private FlowObjectInfo[] convListToInfo(List<? extends PLFlowObject> list) {
|
FlowObjectInfo[] flowObjectInfo = new FlowObjectInfo[list.size()];
|
for (int i = 0; i < list.size(); i++) {
|
PLFlowObject flowObject = list.get(i);
|
flowObjectInfo[i] = new FlowObjectInfo();
|
flowObjectInfo[i].ploid = flowObject.getPloid() == null ? "" : flowObject.getPloid();
|
flowObjectInfo[i].plexecutionid = flowObject.getPlexecutionid() == null ? "" : flowObject.getPlexecutionid();
|
flowObjectInfo[i].plprocesstype = flowObject.getPlprocesstype() == null ? "" : flowObject.getPlprocesstype();
|
flowObjectInfo[i].plobjectid = flowObject.getPlobjectid() == null ? "" : flowObject.getPlobjectid();
|
flowObjectInfo[i].initStatus = flowObject.getInitStatus() == null ? "" : flowObject.getInitStatus();
|
}
|
return flowObjectInfo;
|
}
|
|
public String getDeploymentIdByExecutionId(String executionId) {
|
return new ProcessTemplateService().getDeploymentIdByExecutionId(executionId);
|
}
|
|
public void endProcessInstance(String processInstanceId) throws VCIError {
|
new ProcessTemplateService(this.getUserEntity()).endProcessInstance(processInstanceId);
|
}
|
public void endProcessInstanceByplatform(String processInstanceId) throws VCIError {
|
new ProcessTemplateService(this.getUserEntity()).endProcessInstanceByplatform(processInstanceId);
|
}
|
|
public ProcessDefinitionInfo[] getProcessDefinitionByType(String processType) throws VCIError {
|
|
ProcessDefinitionInfo[] infos = new ProcessDefinitionInfo[0];
|
try {
|
List<ProcessDefinition> processDefinitions = new ProcessTemplateService().getProcessDefinitionByType(processType);
|
ProcessDefinition[] objects = processDefinitions.toArray(new ProcessDefinition[] {});
|
infos = this.convertProcessDefinitionsToProcessDefinitionInfos(objects);
|
} catch (Exception ex) {
|
throw new VCIError("410109", new String[] {});
|
}
|
return infos;
|
}
|
|
|
public String getDepolymentID(String executionId) throws VCIError {
|
String str = "";
|
try{
|
ProcessTemplateService srv = new ProcessTemplateService();
|
str = srv.getDepolymentID(executionId);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("-1", new String[] {});
|
}
|
return str;
|
}
|
public byte[] getFlowImageByDeployID(String deployID) throws VCIError,IOException {
|
return new ProcessTemplateService().getFlowImageByDeployID(deployID);
|
}
|
// public FlowTaskInfo[] getDoneTaskByUserId(String pluseroid,int first,int pageSize, String expandSql) {
|
// return new ProcessTemplateService().getDoneTaskByUserId(pluseroid,first,pageSize, expandSql);
|
// }
|
|
/**
|
* 已办任务
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param taskType
|
* @param querySQL
|
* @return
|
*/
|
public FlowTaskInfo[] getDoneTaskByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) {
|
return new ProcessTemplateService().getDoneTaskByUserId(pluseroid, first, pageSize, taskType, querySQL);
|
}
|
/**
|
* 已办任务-可排序
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param taskType
|
* @param querySQL
|
* @param orderStr
|
* @return
|
*/
|
public FlowTaskInfo[] getDoneTaskCompositorByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL,String orderStr) {
|
return new ProcessTemplateService().getDoneTaskCompositorByUserId(pluseroid, first, pageSize, taskType, querySQL, orderStr);
|
}
|
|
// public int queryDoneTaskCount(String pluseroid, String expandSql) throws VCIError{
|
// int count = 1;
|
// try{
|
// count = new ProcessTemplateService().queryDoneTaskCount(pluseroid, expandSql);
|
// }catch(Exception ex) {
|
// ex.printStackTrace();
|
// throw new VCIError(410117, new String[] {});
|
// }
|
// return count;
|
// }
|
/**
|
* 已办任务总数
|
* @param pluseroid
|
* @param expandSql
|
* @return
|
* @throws VCIError
|
*/
|
public int queryDoneTaskCount(String pluseroid,String expandSql) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryDoneTaskCount(pluseroid, expandSql);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410117", new String[] {});
|
}
|
return count;
|
}
|
public boolean checkKey(String name, String keyValue) throws VCIError{
|
return new ProcessTemplateService().checkKey(name, keyValue);
|
}
|
public String[] getDeployId(String taskId) throws VCIError {
|
return new ProcessTemplateService().getDeployId(taskId);
|
}
|
|
/**
|
* 判断下一任务节点是否是end节点
|
* @param jbpmDeploymentId
|
* @param taskName
|
* @return
|
* @throws VCIError
|
*/
|
public boolean getProcessTaskByTaskName(String taskId,String taskName,String outcome) throws VCIError{
|
try {
|
return new ProcessTemplateService().getProcessTaskByTaskName(taskId, taskName, outcome);
|
} catch (Exception e) {
|
e.printStackTrace();
|
throw new VCIError("410202", new String[]{e.getMessage()});
|
}
|
}
|
|
/**
|
* 五院专用
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @return
|
*/
|
public FlowTaskInfo[] getTodoTaskByUser(String pluseroid,int first,int pageSize) {
|
FlowTaskInfo[] taskInfo = new ProcessTemplateService().getTodoTaskByUserId(pluseroid,first,pageSize,"","");
|
// FlowTaskInfo[] todoTask = new FlowTaskInfo[taskInfo.length];
|
for(int i=0;i<taskInfo.length;i++){
|
taskInfo[i].executionId = convertGBKToISO_8859_1(taskInfo[i].executionId);
|
taskInfo[i].plclsfoid = convertGBKToISO_8859_1(taskInfo[i].plclsfoid);
|
taskInfo[i].createTime = taskInfo[i].createTime;
|
taskInfo[i].create = convertGBKToISO_8859_1(taskInfo[i].create);
|
taskInfo[i].desc = convertGBKToISO_8859_1(taskInfo[i].desc);
|
taskInfo[i].name = convertGBKToISO_8859_1(taskInfo[i].name);
|
taskInfo[i].templateName = convertGBKToISO_8859_1(taskInfo[i].templateName);
|
taskInfo[i].processName = convertGBKToISO_8859_1(taskInfo[i].processName);
|
}
|
return taskInfo;
|
}
|
|
static String convertGBKToISO_8859_1(String text){
|
return convertEncoding(text, "GBK", "ISO-8859-1");
|
}
|
static String convertISO_8859_1ToGBK(String text){
|
return convertEncoding(text, "ISO-8859-1", "GBK");
|
}
|
static String convertEncoding(String text, String fromEncoding, String toEncoding){
|
String res = text;
|
try {
|
res = new String(text.getBytes(fromEncoding), toEncoding);
|
} catch (UnsupportedEncodingException e) {
|
e.printStackTrace();
|
}
|
return res;
|
}
|
|
public String[] getNextTask(String executionId, String taskName,
|
String outcome) throws VCIError {
|
executionId = convertISO_8859_1ToGBK(executionId);
|
taskName = convertISO_8859_1ToGBK(taskName);
|
outcome = convertISO_8859_1ToGBK(outcome);
|
String jbpmDeploymentId = getDeploymentIdByExecutionId(executionId);
|
String[] nextTaskNames = getNextTaskNames(jbpmDeploymentId, taskName, outcome);
|
for(int i=0;i<nextTaskNames.length;i++){
|
nextTaskNames[i] = convertGBKToISO_8859_1(nextTaskNames[i]);
|
}
|
return nextTaskNames;
|
}
|
public String[] getUserNames(String executionId, String taskName,
|
String outcome) throws VCIError {
|
executionId = convertISO_8859_1ToGBK(executionId);
|
// taskName = convertISO_8859_1ToGBK(taskName);
|
// outcome = convertISO_8859_1ToGBK(outcome);
|
String jbpmDeploymentId = getDeploymentIdByExecutionId(executionId);
|
String[] userName = getCurCandidates(jbpmDeploymentId, taskName, outcome, executionId);
|
for(int i=0;i<userName.length;i++){
|
userName[i] = convertGBKToISO_8859_1(userName[i]);
|
}
|
return userName;
|
}
|
|
//获取全部任务列表
|
public String[] getAllTaskNames(String jbpmDeploymentId) throws VCIError {
|
try {
|
return new ProcessTemplateService(this.getUserEntity()).getAllTaskNames(jbpmDeploymentId);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return new String[0];
|
}
|
//获取任务对用的自定义URl
|
public String getUrlPath(String jbpmDeploymentId,String taskName) throws VCIError {
|
try {
|
return new ProcessTemplateService(this.getUserEntity()).getUrlPath(jbpmDeploymentId, taskName);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return "";
|
}
|
//获取路由对应的自定义URl
|
public String[] getTrainsitionUrlPath(String jbpmDeploymentId,String taskName,String trainsitionName) throws VCIError {
|
try {
|
return new ProcessTemplateService(this.getUserEntity()).getTrainsitionUrlPath(jbpmDeploymentId, taskName, trainsitionName);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return new String[]{};
|
}
|
/**
|
* 转交任务
|
* @param fromUser
|
* @param username
|
* @return
|
* @throws VCIError
|
*/
|
public boolean assignTask(String fromUser,String username) throws VCIError {
|
boolean flag = false;
|
try {
|
flag = new ProcessTemplateService(this.getUserEntity()).assignTask(fromUser,username);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return flag;
|
}
|
public boolean assignTaskByPlatform(String taskId,String username) throws VCIError {
|
boolean flag = false;
|
try {
|
flag = new ProcessTemplateService(this.getUserEntity()).assignTaskByPlatform(taskId,username);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return flag;
|
}
|
|
/**
|
* 任务转发
|
* @param taskid
|
* @param toUserName
|
* @return
|
*/
|
public boolean transmitTask(String taskid,String toUserName,UserEntityInfo userEntityInfo){
|
boolean flag = false;
|
try {
|
flag = new ProcessTemplateService(this.getUserEntity()).transmitTask(taskid, toUserName);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return flag;
|
}
|
public boolean transmitTaskByPlatform(String[] taskids,String toUserName,UserEntityInfo userEntityInfo){
|
boolean flag = false;
|
try {
|
for(String taskid : taskids){
|
new ProcessTemplateService(this.getUserEntity()).transmitTaskByPlatform(taskid, toUserName);
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return flag;
|
}
|
|
|
/**
|
* 获取当前任务路由
|
* @param taskID 任务ID
|
* @return
|
* @throws VCIError
|
*/
|
public String[] getAllOutComes(String taskID) throws VCIError{
|
try{
|
|
return new ProcessTemplateService().getAllOutComes(taskID);
|
}catch(Exception e){
|
e.getStackTrace();
|
throw new VCIError("410301",new String[0]);
|
}
|
|
}
|
|
public boolean saveOrUpdateTasksAssigned(TasksAssignedInfo tasksAssignedInfo) throws VCIError{
|
boolean res = false;
|
TasksAssigned tasksAssigned = new TasksAssigned();
|
tasksAssigned.setId(tasksAssignedInfo.id);
|
// tasksAssigned.setTasksId(tasksAssignedInfo.TasksId);
|
tasksAssigned.setTasksName(tasksAssignedInfo.TasksName);
|
tasksAssigned.setUserName(tasksAssignedInfo.userName);
|
// tasksAssigned.setTasksTrueName(tasksAssignedInfo.TasksTrueName);
|
tasksAssigned.setIsTrue(tasksAssignedInfo.isTrue);
|
tasksAssigned.setStartTime(new Date(tasksAssignedInfo.startTime));
|
tasksAssigned.setEndTime(new Date(tasksAssignedInfo.endTime));
|
tasksAssigned.setFromUser(tasksAssignedInfo.fromUser);
|
try{
|
res = new ProcessTemplateService().saveOrUpdateTasksAssigned(tasksAssigned);
|
}catch(Exception e){
|
e.getStackTrace();
|
}
|
return res;
|
}
|
|
public TasksAssignedInfo getTasksAssignedByUserName(String userName) throws VCIError{
|
TasksAssigned tasksAssigned;
|
tasksAssigned = new ProcessTemplateService(this.getUserEntity()).getTasksAssignedByUserName(userName);
|
TasksAssignedInfo info = new TasksAssignedInfo();
|
info.id = tasksAssigned.getId();
|
// info.TasksId = tasksAssigned.getTasksId();
|
info.TasksName = tasksAssigned.getTasksName();
|
// info.TasksTrueName = tasksAssigned.getTasksTrueName();
|
info.userName = tasksAssigned.getUserName();
|
info.isTrue = tasksAssigned.getIsTrue();
|
info.startTime = tasksAssigned.getStartTime().getTime();
|
info.endTime = tasksAssigned.getEndTime().getTime();
|
info.fromUser = tasksAssigned.getFromUser()==null?"":tasksAssigned.getFromUser();
|
return info;
|
}
|
|
public TasksAssignedInfo[] getAllTasksAssignedByUserName(String userName) throws VCIError{
|
TasksAssigned[] tasksAssigneds = new ProcessTemplateService(this.getUserEntity()).getAllTasksAssignedByUserName(userName);
|
|
List<TasksAssignedInfo> lstTaskAssign = new ArrayList<TasksAssignedInfo>();
|
|
for (TasksAssigned a : tasksAssigneds){
|
TasksAssignedInfo info = new TasksAssignedInfo();
|
info.id = a.getId();
|
// info.TasksId = tasksAssigned.getTasksId();
|
info.TasksName = a.getTasksName();
|
// info.TasksTrueName = tasksAssigned.getTasksTrueName();
|
info.userName = a.getUserName();
|
info.isTrue = a.getIsTrue();
|
info.startTime = a.getStartTime().getTime();
|
info.endTime = a.getEndTime().getTime();
|
info.fromUser = a.getFromUser()==null?"":a.getFromUser();
|
|
lstTaskAssign.add(info);
|
}
|
return lstTaskAssign.toArray(new TasksAssignedInfo[0]);
|
}
|
|
public void saveSubProcess(SubprocessTemInfo[] subprocessTemInfos){
|
new ProcessTemplateService().saveSubProcess(subprocessTemInfos);
|
}
|
public int checkSubprocessQuote(String subProcess){
|
return new ProcessTemplateService().checkSubprocessQuote(subProcess);
|
}
|
|
public void configTaskAndUser(String deploymentId,String[] dataIds,String[] taskName,String[][] userName){
|
Map<String,String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for(int i=0;i<taskName.length;i++){
|
taskAndUserMap.put(taskName[i], userName[i]);
|
}
|
// new ProcessTemplateService().configTaskAndUser(deploymentId, dataIds, taskAndUserMap);
|
}
|
|
/**
|
* 通过流程定义ID获取部署ID
|
* @param processDifId
|
* @return
|
*/
|
public String getDeployIdByProcessDefintionId(String processDifId){
|
return new ProcessTemplateService().getDeployIdByProcessDefintionId(processDifId);
|
}
|
/**
|
* 判断节点是否是end节点
|
* @param jbpmDeploymentId
|
* @param endTaskName
|
* @return
|
* @throws Exception
|
*/
|
public boolean getEndNode(String jbpmDeploymentId,String endTaskName){
|
try {
|
return new ProcessTemplateService().getEndNode(jbpmDeploymentId, endTaskName);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return false;
|
}
|
}
|
|
public boolean isEndNode(String executionId,String endTaskName){
|
try {
|
executionId = convertISO_8859_1ToGBK(executionId);
|
endTaskName = convertISO_8859_1ToGBK(endTaskName);
|
ServerWithLog4j.logger.debug("executionId=="+executionId + "; endTaskName=="+endTaskName);
|
String jbpmDeploymentId = getDeploymentIdByExecutionId(executionId);
|
ServerWithLog4j.logger.debug("isEndNode==jbpmDeploymentId=="+jbpmDeploymentId);
|
return getEndNode(jbpmDeploymentId, endTaskName);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return false;
|
}
|
}
|
|
public String getNextTaskAssigner(String executionId, String taskName) {
|
return new ProcessTemplateService().getNextTaskAssigner(executionId, taskName);
|
}
|
public String getNextSubTaskAssigner(String executionId, String taskName, String outcome) throws Exception {
|
return new ProcessTemplateService().getNextSubTaskAssigner(executionId, taskName, outcome);
|
}
|
|
public ProcessTaskInfo findTaskPropertyByProcessId(String jbpmDeploymentId) {
|
return new ProcessTemplateService().findTaskPropertyByProcessId(jbpmDeploymentId);
|
}
|
/**
|
* 返回任节点上定义的候选人字符串内容
|
* <p>Description: </p>
|
*
|
* @author xchao
|
* @time 2012-11-10
|
* @param jbpmDeploymentId
|
* @param taskName
|
* @param outcome
|
* @return
|
* @throws Exception
|
*/
|
public String getNextCandidatesDefineString(String jbpmDeploymentId, String taskName,
|
String outcome) throws VCIError {
|
String res = "";
|
try {
|
res = new ProcessTemplateService().getNextCandidatesDefineString(jbpmDeploymentId, taskName, outcome);
|
} catch (Exception ex) {
|
throw new VCIError("410122", new String[] {});
|
}
|
return res;
|
}
|
|
/**
|
* 流程监控
|
* @param pluseroid
|
* @param first
|
* @param pageSize
|
* @param taskType
|
* @param querySQL
|
* @return
|
*/
|
public FlowTaskInfo[] getProcessControlByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) {
|
return new ProcessTemplateService().getProcessControlByUserId(pluseroid,first,pageSize,taskType,querySQL);
|
}
|
public int queryProcessControlCount(String pluseroid,String taskType) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryProcessControlCount(pluseroid,taskType);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410117", new String[] {});
|
}
|
return count;
|
}
|
|
public FlowTaskInfo[] getDoneProcessByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) {
|
return new ProcessTemplateService().getDoneProcessByUserId(pluseroid,first,pageSize,taskType,querySQL);
|
}
|
public int queryDoneProcessCount(String pluseroid,String taskType) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryDoneProcessCount(pluseroid,taskType);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410117", new String[] {});
|
}
|
return count;
|
}
|
|
/**
|
* 查询流程模板的第一个任务对象
|
* <p>Description: </p>
|
*
|
* @author xchao
|
* @time 2012-6-6
|
* @param jbpmDeploymentId 流程模板部署的ID
|
* @return
|
* @throws VCIError
|
*/
|
public ProcessTaskInfo getFirstProcessTask(String jbpmDeploymentId) throws VCIError{
|
try{
|
ProcessTask processTask = new ProcessTemplateService().getFirstProcessTask(jbpmDeploymentId);
|
return this.findTaskPropertyById(jbpmDeploymentId, processTask.getTaskName());
|
}catch(Exception ex){
|
ex.printStackTrace();
|
throw new VCIError("410117", new String[]{ex.getMessage()});
|
}
|
}
|
public ProcessTaskInfo getFirstProcessTaskByExecId(String execId) throws VCIError{
|
try{
|
String jbpmDeploymentId = getDeploymentIdByExecutionId(execId);
|
ProcessTask processTask = new ProcessTemplateService().getFirstProcessTask(jbpmDeploymentId);
|
return this.findTaskPropertyById(jbpmDeploymentId, processTask.getTaskName());
|
}catch(Exception ex){
|
ex.printStackTrace();
|
throw new VCIError("410117", new String[]{ex.getMessage()});
|
}
|
}
|
|
/**
|
*
|
* <p>查询当前节点同意的所有的下一任务节点数据:
|
* 返回格式:transitionName,TaskName;transitionName,TaskName;的字符串值
|
* </p>
|
*
|
* @time 2013-3-31
|
* @param taskId 任务ID
|
* @param taskName 任务名称
|
* @param outcome 同意或者不同意;
|
* @return
|
*/
|
public String getAllNoAgreeProcessTaskByTaskName(String taskId,String taskName,String outcome) throws VCIError{
|
try {
|
return new ProcessTemplateService().getAllNoAgreeProcessTaskByTaskName(taskId, taskName, outcome);
|
} catch (Exception e) {
|
e.printStackTrace();
|
throw new VCIError("410202", new String[]{e.getMessage()});
|
}
|
}
|
public boolean setNodeHide(String deploymentId) throws VCIError {
|
return new ProcessTemplateService().setNodeHide(deploymentId);
|
}
|
//隐藏流程节点方法
|
public NodeHideInfo[] getNodeHideDeploymentId() {
|
List<NodeHide> list = null;
|
ProcessTemplateService uservice = new ProcessTemplateService();
|
list = uservice.getNodeHideDeploymentId();
|
NodeHideInfo[] info = new NodeHideInfo[list.size()];
|
for(int i=0;i<list.size();i++) {
|
info[i] = changeNodeHideToNodeHideInfo(list.get(i));
|
}
|
return info;
|
}
|
public NodeHideInfo changeNodeHideToNodeHideInfo(NodeHide nodehide) {
|
NodeHideInfo info = new NodeHideInfo();
|
info.deploymentId = nodehide.getDeploymentId();
|
info.hide = nodehide.getHide();
|
info.id = nodehide.getId();
|
return info;
|
}
|
public boolean deleteHideFlow(String deployId) throws VCIError{
|
boolean res = false;
|
try{
|
res = new ProcessTemplateService().deleteHideFlow(deployId);
|
}catch(Exception e) {
|
throw new VCIError("410203",new String[0]);
|
}
|
return res;
|
}
|
public FlowTaskInfo[] getTaskByCondition(String[] values,int first,int pageSize,String objectId) throws VCIError{
|
FlowTaskInfo[] infos = null;
|
try{
|
infos = new ProcessTemplateService().getTaskByCondition(values,first,pageSize,objectId);
|
}catch(Exception e) {
|
throw new VCIError("410121", new String[] {});
|
}
|
return infos;
|
}
|
public int queryFlowTaskCount(String[] values,String objectId,boolean flag) throws VCIError{
|
int count = 1;
|
try{
|
count = new ProcessTemplateService().queryFlowTaskCount(values,objectId,flag);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410120", new String[] {});
|
}
|
return count;
|
}
|
public String getNextTaskNameByJbpmId(String jbpmDeploymentId, String taskName, String outcome) throws VCIError{
|
String res = "";
|
try{
|
res = new ProcessTemplateService().getNextTaskNameByJbpmId(jbpmDeploymentId,taskName,outcome);
|
}catch(Exception e) {
|
throw new VCIError("410204", new String[] {});
|
}
|
return res;
|
}
|
public String getNextTaskTypeByJbpmId(String jbpmDeploymentId, String taskName, String outcome) throws VCIError{
|
String res = "";
|
try{
|
res = new ProcessTemplateService().getNextTaskTypeByJbpmId(jbpmDeploymentId,taskName,outcome);
|
}catch(Exception e) {
|
throw new VCIError("410204", new String[] {});
|
}
|
return res;
|
}
|
public String getProcessStartUser(String execId)throws VCIError {
|
String res = "";
|
try {
|
res = new ProcessTemplateService().getProcessStartUser(execId);
|
}catch(Exception e) {
|
throw new VCIError("410205",new String[0]);
|
}
|
return res;
|
}
|
/**
|
* 通过执行标示查询任务ID
|
* <p>Description: </p>
|
*
|
* @time 2013-4-27
|
* @param execId
|
* @return
|
* @throws VCIError
|
*/
|
public String getProcessTaskId(String execId)throws VCIError {
|
String res = "";
|
try {
|
res = new ProcessTemplateService().getProcessTaskId(execId);
|
}catch(Exception e) {
|
throw new VCIError("410205",new String[0]);
|
}
|
return res;
|
}
|
public boolean setProcessHide(String jbpmdeplotmentId,int status) throws VCIError{
|
boolean res = false;
|
try{
|
res = new ProcessTemplateService().setProcessHide(jbpmdeplotmentId,status);
|
}catch(Exception e) {
|
if(status ==0){
|
throw new VCIError("410301",new String[0]);
|
}else throw new VCIError("410302",new String[0]);
|
}
|
return res;
|
}
|
/**
|
* 获取策略列表
|
* @param taskName
|
* @param deploymentId
|
* @return
|
*/
|
public TaskRevokeInfo[] getTaskRevokeList(String taskName, String deploymentId){
|
List<TaskRevokeSObject> list = new ProcessTemplateService().getTaskRevokeList(taskName, deploymentId);
|
TaskRevokeInfo[] taskRevokeInfo = new TaskRevokeInfo[list.size()];
|
for(int i=0;i<list.size();i++){
|
TaskRevokeSObject object = list.get(i);
|
taskRevokeInfo[i] = convertTaskRevokeObjToInfo(object);
|
}
|
return taskRevokeInfo;
|
}
|
private TaskRevokeInfo convertTaskRevokeObjToInfo(TaskRevokeSObject o){
|
TaskRevokeInfo info = new TaskRevokeInfo();
|
info.id = o.getId() == null ? "" : o.getId();
|
info.deploymentId = o.getPljbpmdeploymentid() == null?"":o.getPljbpmdeploymentid();
|
info.taskName = o.getPltask() ==null?"":o.getPltask();
|
info.className = o.getPlclassname()==null?"":o.getPlclassname();
|
info.revokeflag = o.getPlrevoke() ==null ? "" : o.getPlrevoke();
|
return info;
|
}
|
public boolean deleteTasksAssignedByUserName(String[] userName) throws VCIError {
|
boolean res = false;
|
try{
|
res = new ProcessTemplateService().deleteTasksAssignedByUserName(userName);
|
}catch(Exception e){
|
e.getStackTrace();
|
}
|
return res;
|
}
|
|
public boolean deleteTasksAssignedByIds(String[] ids) throws VCIError {
|
boolean res = false;
|
try{
|
//System.out.println("===============ProcessCustomDelegate.deleteTasksAssignedByIds===============");
|
res = new ProcessTemplateService().deleteTasksAssignedByIds(ids);
|
}catch(Exception e){
|
e.getStackTrace();
|
}
|
return res;
|
}
|
|
public void setParticipation(String nextTaskId,String[] userNames) throws VCIError{
|
try{
|
new ProcessTemplateService().setParticipation(nextTaskId, userNames);
|
}catch(Exception e){
|
e.getStackTrace();
|
throw new VCIError("410302",new String[0]);
|
}
|
}
|
/**
|
* 获取任务的所有候选人包含自定义用户
|
* @param taskName
|
* @param deploymentId
|
* @param outcome
|
* @return
|
*/
|
public String[] getAllUserListForTask(String taskName, String deploymentId,String outcome,String [] varKey, String[] varValue){
|
List<String> allUserListForTask = new ProcessTemplateService().getAllUserListForTask(taskName, deploymentId, outcome,varKey, varValue);
|
return allUserListForTask.toArray(new String[0]);
|
}
|
/**
|
* 撤销任务
|
* @param assignName
|
* @param destActivityName
|
* @param executionId
|
* @return
|
*/
|
public boolean revokeTask(String taskName,String destActivityName, String executionId){
|
return new ProcessTemplateService().revokeTask(taskName, destActivityName, executionId);
|
}
|
/**
|
* 任务指派
|
* @param destActivityName
|
* @param tagActivityName
|
* @param classNames
|
* @param userNames
|
* @return
|
*/
|
public boolean appointTask(String destActivityName,String tagActivityName,String[] classNames,String executionId, String[] userNames){
|
return new ProcessTemplateService().appointTask(destActivityName, tagActivityName, classNames,executionId, userNames);
|
}
|
/**
|
* 任务指派
|
* @param destActivityName
|
* @param tagActivityName
|
* @param classNames
|
* @param userNames
|
* @return
|
*/
|
public boolean appointTask2(String destActivityName,String tagActivityName,String[] classNames,String executionId, String[] userNames, UserEntityInfo userEntityInfo){
|
return new ProcessTemplateService(this.getUserEntity()).appointTask2(destActivityName, tagActivityName, classNames,executionId, userNames, userEntityInfo);
|
}
|
/**
|
* 返回流程执行时的参数值
|
* <p>Description: </p>
|
* @author xchao
|
* @time 2013-5-24
|
* @param executionId 流程执行ID
|
* @param varName 变量名称
|
* @return
|
*/
|
public String getProcessVariable(String executionId, String varName) throws VCIError{
|
String str = "";
|
try{
|
ProcessTemplateService srv = new ProcessTemplateService();
|
str = srv.getProcessVariable(executionId, varName);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("410401", new String[] {ex.getMessage()});
|
}
|
return str;
|
}
|
public String[] getTasksNameByProcessName(final String[] processNames) throws VCIError{
|
List<String> list = new LinkedList<String>();
|
try {
|
list = new ProcessTemplateService().getTasksNameByProcessName(processNames);
|
} catch (SQLException e) {
|
e.printStackTrace();
|
throw new VCIError("410303",new String[0]);
|
}
|
return list.toArray(new String[0]);
|
}
|
/**
|
*
|
* <p>Description: 查看已办任务的详细信息</p>
|
*
|
* @time 2013-4-11
|
* @param executionId
|
* @return
|
* @throws VCIError
|
*/
|
public String searchComplateTask(String[] param) throws VCIError {
|
String str = "";
|
try{
|
ProcessTemplateService srv = new ProcessTemplateService();
|
str = srv.searchComplateTask(param);
|
}catch(Exception ex) {
|
ex.printStackTrace();
|
throw new VCIError("-1", new String[] {});
|
}
|
return str;
|
}
|
public TasksAssignedInfo[] getTasksAssignedByPageing(LongHolder total,QueryParamInfo queryParamInfo) throws VCIError{
|
TasksAssignedInfo[] infos = new TasksAssignedInfo[0];
|
try{
|
QueryParam queryParam = this.convertQueryParam(queryParamInfo);
|
QueryResult<TasksAssigned> res = new ProcessTemplateService(this.getUserEntity()).getTasksAssignedByPageing(queryParam);
|
total.value = res.getTotal();
|
TasksAssigned[] objects = res.getDatas();
|
infos = this.coventObjectListToInfoList(objects);
|
}catch(Exception ex){
|
throw new VCIError("810005", new String[]{});
|
}
|
return infos;
|
}
|
private QueryParam convertQueryParam(QueryParamInfo info){
|
QueryParam obj = new QueryParam();
|
obj.setCustomQueryString(info.customQueryString);
|
obj.setPageIndex(info.pageIndex);
|
obj.setPageSize(info.pageSize);
|
return obj;
|
}
|
private TasksAssignedInfo[] coventObjectListToInfoList(TasksAssigned[] obj){
|
TasksAssignedInfo[] infos = new TasksAssignedInfo[obj.length];
|
for(int i = 0;i<obj.length;i++){
|
infos[i] = this.coventObjectToInfo(obj[i]);
|
}
|
return infos;
|
}
|
private TasksAssignedInfo coventObjectToInfo(TasksAssigned tasksAssigned){
|
TasksAssignedInfo info = new TasksAssignedInfo();
|
info.id = tasksAssigned.getId() == null ? "" : tasksAssigned.getId();
|
info.userName = tasksAssigned.getUserName() == null ? "" : tasksAssigned.getUserName();
|
// info.TasksId = tasksAssigned.getTasksId() == null ? "" : tasksAssigned.getTasksId();
|
info.TasksName = tasksAssigned.getTasksName() == null ? "" : tasksAssigned.getTasksName();
|
// info.TasksTrueName = tasksAssigned.getTasksTrueName() == null ? "" : tasksAssigned.getTasksTrueName();
|
info.isTrue = tasksAssigned.getIsTrue();
|
info.startTime = tasksAssigned.getStartTime() == null ? 0 : tasksAssigned.getStartTime().getTime();
|
info.endTime = tasksAssigned.getEndTime() == null ? 0 : tasksAssigned.getEndTime().getTime();
|
info.fromUser=tasksAssigned.getFromUser()==null?"":tasksAssigned.getFromUser();
|
return info;
|
}
|
public String getTaskId(String currActivityName,String executionId){
|
return new ProcessTemplateService().getTaskId(currActivityName, executionId);
|
}
|
public String[] getOutComesByTaskName(String jbpmDeploymentId,String taskName){
|
try {
|
return new ProcessTemplateService().getOutComesByTaskName(jbpmDeploymentId, taskName);
|
} catch (Exception e) {
|
return new String[0];
|
}
|
}
|
|
/**
|
* 通过流程模板key,获取流程部署id
|
* @param processDefinitionKey
|
* @return
|
*/
|
public String getDeploymentID(String processDefinitionKey) {
|
BigDecimal deploymentID = new ProcessTemplateService().getDeploymentID(processDefinitionKey);
|
return String.valueOf(deploymentID);
|
}
|
|
|
public String[] getFirstTasksAssigneeByCatid(String catid) throws VCIError
|
{
|
ArrayList list = new ArrayList();
|
ProcessDefinitionInfo[] pdis = this.getProcessDefinitions(catid);
|
for( int i=0;i<pdis.length;i++ )
|
{
|
ProcessDefinitionInfo pdi = pdis[i];
|
ProcessTaskInfo pti = this.getFirstProcessTask(pdi.jbpmDeploymentId);
|
String[] temps = this.getCurCandidates(pdi.jbpmDeploymentId, pti.taskName, "", null);
|
for(int j=0;j<temps.length;j++)
|
{
|
String temp = pdi.jbpmDeploymentId + "==" + temps[j];
|
list.add(temp);
|
}
|
|
}
|
return (String[]) list.toArray(new String[list.size()]);
|
// return (String[])list.toArray();
|
}
|
|
/**
|
* 获取流程名称
|
* @param executionid
|
* @return
|
*/
|
public String getProcessName(String executionid){
|
return new ProcessTemplateService().getProcessName(executionid);
|
}
|
|
public FlowTaskInfo getFlowTaskInfo(String exectionId, String taskid) throws VCIError{
|
try{
|
return new ProcessTemplateService().getFlowTaskInfo(exectionId, taskid);
|
}catch(Exception ex){
|
throw new VCIError("410115", new String[]{});
|
}
|
}
|
|
public FlowApproveHistoryInfo[] getHistoryActivityByProInsIdbyPLM(
|
String processInstanceId) {
|
List<FlowApproveHistory> list = new ProcessTemplateService().getHistoryActivityByProInsIdbyPLM(processInstanceId);
|
return convListToFlowApproveHistoryInfo(list);
|
}
|
|
public String startPocessByPLM_v1(String processDefinitionKey,
|
FlowInstanceInfo flowInstanceInfo, String[] objId,
|
UserEntityInfo userEntityInfo, String[] userName, String outcome,
|
String[] tasknames, String[][] taskUserNames,
|
MapTransfersInfo[] mapTransfersServerObject,
|
String[] objectProperty, String[][] objectPropertyValues)
|
throws VCIError {
|
Map<String, String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for (int i = 0; i < tasknames.length; i++) {
|
taskAndUserMap.put(tasknames[i], taskUserNames[i]);
|
}
|
Map<String, Object> mapParams = new HashMap<String, Object>();
|
for (int i = 0; i < mapTransfersServerObject.length; i++) {
|
mapParams.put(mapTransfersServerObject[i].key,
|
mapTransfersServerObject[i].value);
|
}
|
return new ProcessTemplateService(this.getUserEntity())
|
.startPocessByPLM_v1(processDefinitionKey, flowInstanceInfo,
|
objId, userName, outcome, taskAndUserMap, mapParams,
|
objectProperty, objectPropertyValues, userEntityInfo);
|
}
|
|
public String startProcessAndExecuteFirstNode(String processDefinitionKey,
|
FlowInstanceInfo flowInstanceInfo, String[] objId,
|
UserEntityInfo userEntityInfo, String[] userName, String outcome,
|
String[] tasknames, String[][] taskUserNames,
|
MapTransfersInfo[] mapTransfersServerObject,
|
String[] objectProperty, String[][] objectPropertyValues)
|
throws VCIError {
|
Map<String, String[]> taskAndUserMap = new HashMap<String, String[]>();
|
for (int i = 0; i < tasknames.length; i++) {
|
taskAndUserMap.put(tasknames[i], taskUserNames[i]);
|
}
|
Map<String, Object> mapParams = new HashMap<String, Object>();
|
for (int i = 0; i < mapTransfersServerObject.length; i++) {
|
mapParams.put(mapTransfersServerObject[i].key,
|
mapTransfersServerObject[i].value);
|
}
|
return new ProcessTemplateService(this.getUserEntity())
|
.startProcessAndExecuteFirstNode(processDefinitionKey,
|
flowInstanceInfo, objId, userEntityInfo, userName,
|
outcome, taskAndUserMap, mapParams, objectProperty,
|
objectPropertyValues);
|
}
|
|
public boolean completeTaskByPlatform_v1(String taskId, String outcome,
|
String nextTask, String approvalNote,
|
UserEntityInfo userEntityInfo, String[] userName,
|
String[] objectProperty, String[][] objectPropertyValues)
|
throws VCIError {
|
try {
|
return new ProcessTemplateService(this.getUserEntity())
|
.completeTaskByPlatform_v1(taskId, outcome, nextTask,
|
approvalNote, userEntityInfo, userName,
|
objectProperty, objectPropertyValues);
|
} catch (VCIError e) {
|
throw e;
|
}
|
}
|
|
public boolean completeTasksByPlatform_v1(String[] taskIds, String outcome,
|
String nextTask, String approvalNote,
|
UserEntityInfo userEntityInfo, String[] userName,
|
String[] objectProperty, String[][] objectPropertyValues)
|
throws VCIError {
|
try {
|
return new ProcessTemplateService(this.getUserEntity())
|
.completeTasksByPlatform_v1(taskIds, outcome, nextTask,
|
approvalNote, userEntityInfo, userName,
|
objectProperty, objectPropertyValues);
|
} catch (VCIError e) {
|
throw e;
|
}
|
}
|
|
public boolean resetNodeUser(String executionId, String[] taskNames,
|
String[] userNames) throws VCIError {
|
return new ProcessTemplateService(this.getUserEntity()).resetNodeUser(executionId, taskNames, userNames);
|
}
|
}
|