| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.corba.omd.data.BusinessObject; |
| | | import com.vci.corba.omd.data.LinkObject; |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 启动流程 |
| | | * @param config 启动流程相关配置 |
| | | * @param processNodeUsers 各个节点的负责人信息 |
| | | * @param variablesInfo 相关变量 |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public void startProcess(ProcessStartConfigDTO config, |
| | | Map<String, List<ProcessUserVO>> processNodeUsers, |
| | |
| | | if (config.getTitle().length() > 127) { |
| | | config.setTitle(config.getTitle().substring(0, 127)); |
| | | } |
| | | //SessionInfo si = WebUtil.getSessionInfo(request); |
| | | //weidy修改获取当前用户的方法 |
| | | SessionInfo si = WebUtil.getCurrentUserSessionInfo(); |
| | | |
| | |
| | | |
| | | long currentTime =0L; |
| | | try{ |
| | | // currentTime = platformClientUtil.getLogonFactoryService().getFrameworkService().getSystemTime(); |
| | | currentTime = platformClientUtil.getFrameworkService().getSystemTime(); |
| | | }catch (Throwable e){ |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e),new String[0],e); |
| | | } |
| | |
| | | noticeInfo.setProcessTemplateVO(template); |
| | | BusAnnotationUtil.callForAnnotation(FlowNotifyWeb.class, FlowNotifyBefore.class,noticeInfo); |
| | | String processInstanceId = ""; |
| | | // try { |
| | | // if (config.isAutoSubmitFirst()) { |
| | | // processInstanceId = processDao.getWorkService().startProcessAndExecuteFirstNode(template.getOid(), |
| | | // flowInstanceInfo, |
| | | // objIds, |
| | | // getUserEntityInfo(), |
| | | // firstNodeUserNames, |
| | | // "", |
| | | // allTaskName, |
| | | // allTaskNameUsers, |
| | | // allVariables, |
| | | // objectPropertyKeys, |
| | | // objectPropertyValues); |
| | | // }else{ |
| | | // processInstanceId = processDao.getWorkService().startPocessByPLM_v1( |
| | | // /** |
| | | // * String processDefinitionKey, 流程模板主键 |
| | | // * FlowInstanceInfo flowInstanceInfo, 流程实例 |
| | | // * String[] objId, 数据对象id |
| | | // * UserEntityInfo userEntityInfo, 用户Info |
| | | // * String[] userName, 用户名 |
| | | // * String outcome, 指向 |
| | | // * String[] tasknames, 业务名称 |
| | | // * String[][] taskUserNames, 所属用户名 |
| | | // * MapTransfersInfo[] mapTransfersInfos, 移交Info |
| | | // * String[] objectProperty, 业务属性 |
| | | // * String[][] objectPropertyValues 业务属性值 |
| | | // */ |
| | | // template.getOid(), |
| | | // flowInstanceInfo, |
| | | // objIds, |
| | | // getUserEntityInfo(), |
| | | // firstNodeUserNames, |
| | | // "", |
| | | // allTaskName, |
| | | // allTaskNameUsers, |
| | | // allVariables, |
| | | // objectPropertyKeys, |
| | | // objectPropertyValues |
| | | // ); |
| | | // } |
| | | // } catch (VCIError e) { |
| | | // throw WebUtil.getVciBaseException(e); |
| | | // } |
| | | try { |
| | | if (config.isAutoSubmitFirst()) { |
| | | processInstanceId = processDao.getWorkService().startProcessAndExecuteFirstNode(template.getOid(), |
| | | flowInstanceInfo, |
| | | objIds, |
| | | getUserEntityInfo(), |
| | | firstNodeUserNames, |
| | | "", |
| | | allTaskName, |
| | | allTaskNameUsers, |
| | | allVariables, |
| | | objectPropertyKeys, |
| | | objectPropertyValues); |
| | | }else{ |
| | | processInstanceId = processDao.getWorkService().startPocessByPLMv1( |
| | | /** |
| | | * String processDefinitionKey, 流程模板主键 |
| | | * FlowInstanceInfo flowInstanceInfo, 流程实例 |
| | | * String[] objId, 数据对象id |
| | | * UserEntityInfo userEntityInfo, 用户Info |
| | | * String[] userName, 用户名 |
| | | * String outcome, 指向 |
| | | * String[] tasknames, 业务名称 |
| | | * String[][] taskUserNames, 所属用户名 |
| | | * MapTransfersInfo[] mapTransfersInfos, 移交Info |
| | | * String[] objectProperty, 业务属性 |
| | | * String[][] objectPropertyValues 业务属性值 |
| | | */ |
| | | template.getOid(), |
| | | flowInstanceInfo, |
| | | objIds, |
| | | getUserEntityInfo(), |
| | | firstNodeUserNames, |
| | | "", |
| | | allTaskName, |
| | | allTaskNameUsers, |
| | | allVariables, |
| | | objectPropertyKeys, |
| | | objectPropertyValues |
| | | ); |
| | | } |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | if (StringUtils.isNotBlank(config.getStartStatus())) { |
| | | lifeCycleService.transCboStatus(allCbo, config.getStartStatus()); |
| | | } |
| | |
| | | private void callBefore(List<Map> preWorkitemList,String outcome,String note,long currentTime){ |
| | | if(currentTime == 0L) { |
| | | try { |
| | | // currentTime = platformClientUtil.getLogonFactoryService().getFrameworkService().getSystemTime(); |
| | | currentTime = platformClientUtil.getFrameworkService().getSystemTime(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[0], e); |
| | | } |
| | |
| | | List<Map> workitemList = processDao.getTaskCBOByOid(taskIds); |
| | | long currentTime = 0L; |
| | | try { |
| | | // currentTime = platformClientUtil.getLogonFactoryService().getFrameworkService().getSystemTime(); |
| | | currentTime = platformClientUtil.getFrameworkService().getSystemTime(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[0], e); |
| | | } |
| | | callBefore(workitemList,outCome,note,currentTime); |
| | | // try { |
| | | // if (jbpmTaskIds.length == 1) { |
| | | // processDao.getWorkService().completeTaskByPlatform_v1(jbpmTaskIds[0], outCome, nextTaskName, note, getUserEntityInfo(), nextTaskUsers, objectPropertyKeys, objectPropertyValues); |
| | | // } else { |
| | | // processDao.getWorkService().completeTasksByPlatform_v1(jbpmTaskIds, outCome, nextTaskName, note, getUserEntityInfo(), nextTaskUsers, objectPropertyKeys, objectPropertyValues); |
| | | // } |
| | | // } catch (VCIError e) { |
| | | // throw WebUtil.getVciBaseException(e); |
| | | // } |
| | | try { |
| | | if (jbpmTaskIds.length == 1) { |
| | | processDao.getWorkService().completeTaskByPlatformv1(jbpmTaskIds[0], outCome, nextTaskName, note, getUserEntityInfo(), nextTaskUsers, objectPropertyKeys, objectPropertyValues); |
| | | } else { |
| | | processDao.getWorkService().completeTasksByPlatformv1(jbpmTaskIds, outCome, nextTaskName, note, getUserEntityInfo(), nextTaskUsers, objectPropertyKeys, objectPropertyValues); |
| | | } |
| | | } catch (PLException e) { |
| | | throw WebUtil.getVciBaseException(e); |
| | | } |
| | | callAfter((String)workitemList.get(0).get("executionid"),null,workitemList,currentTime); |
| | | } |
| | | |
| | |
| | | String[] taskOidArray = taskOids.split(","); |
| | | for (String taskOid : taskOidArray) { |
| | | if (StringUtils.isNotBlank(taskOid)) { |
| | | // try { |
| | | // processDao.getWorkService().transmitTask(taskOid, "user:" + userIds, getUserEntityInfo()); |
| | | // } catch (VCIError vciError) { |
| | | // throw WebUtil.getVciBaseException(vciError); |
| | | // } |
| | | try { |
| | | processDao.getWorkService().transmitTask(taskOid, "user:" + userIds, getUserEntityInfo()); |
| | | } catch (PLException vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | WebUtil.alertNotNull(executionId, "流程执行实例的主键"); |
| | | long currentTime = 0L; |
| | | try { |
| | | // currentTime = platformClientUtil.getLogonFactoryService().getFrameworkService().getSystemTime(); |
| | | currentTime = platformClientUtil.getFrameworkService().getSystemTime(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[0], e); |
| | | } |
| | |
| | | } |
| | | long currentTime = 0L; |
| | | try { |
| | | // currentTime = platformClientUtil.getLogonFactoryService().getFrameworkService().getSystemTime(); |
| | | currentTime = platformClientUtil.getFrameworkService().getSystemTime(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[0], e); |
| | | } |
| | |
| | | } |
| | | long currentTime = 0L; |
| | | try { |
| | | // currentTime = platformClientUtil.getLogonFactoryService().getFrameworkService().getSystemTime(); |
| | | currentTime = platformClientUtil.getFrameworkService().getSystemTime(); |
| | | } catch (Throwable e) { |
| | | throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[0], e); |
| | | } |