Package cn.com.manager.tasks.node

Examples of cn.com.manager.tasks.node.ProcessNode


     * @param task
     */
    public static void registTask(Task task) {
        TaskNode currentNode = OperatFactory.getServiceObject(TaskService.class, DataProviderModel.FILE).getTaskNode(task.getNode());
        String nodeName = currentNode.getCurrentNode();
        ProcessNode processNode = new ProcessNode();
        Node n = OperatFactory.getServiceObject(NodeService.class, DataProviderModel.FILE).getNode(nodeName);
        processNode.setAutoFlag(n.isAutoFlag());
        processNode.setNodeName(n.getNodeName());
        processNode.setNodeDesc(n.getNodeDesc());
        processNode.setNodeStatus(n.getNodeStatus());
        task.setProcessNode(processNode);
        task.setDisplay(processNode.getNodeDesc());
        task.setStatus(processNode.getNodeStatus());
        InitiationTaskInfo.initNextProcessNode(processNode);
        BricksCacheManager.INSTANCE.addCacheElement(_CACHE_NAME, task.getTaskid(), task);
    }
View Full Code Here


            Node node = null;
            // 依次设定下一节点
            String nodeName = currentNode.getNextNode();
            if (!StringUtil.isEmpty(nodeName) ) {
                node = OperatFactory.getServiceObject(NodeService.class, DataProviderModel.FILE).getNode(nodeName);
                ProcessNode subNode = new ProcessNode();
                subNode.setAutoFlag(node.isAutoFlag());
                subNode.setNodeName(node.getNodeName());
                subNode.setNodeDesc(node.getNodeDesc());
                subNode.setNodeStatus(node.getNodeStatus());
                processNode.setNext(subNode);
            }
            nodeName = currentNode.getParentNode();
            // 依次设定父节点
            if (!StringUtil.isEmpty(nodeName)) {
                node = OperatFactory.getServiceObject(NodeService.class, DataProviderModel.FILE).getNode(nodeName);
                ProcessNode parentNode = new ProcessNode();
                parentNode.setAutoFlag(node.isAutoFlag());
                parentNode.setNodeName(node.getNodeName());
                parentNode.setNodeDesc(node.getNodeDesc());
                parentNode.setNodeStatus(node.getNodeStatus());
                processNode.setParent(parentNode);
            }
        }
    }
View Full Code Here

     * 任务节点的流转
     * @param state
     */
    public void change() {
        // 保存Task操作记录
        ProcessNode current = task.getProcessNode();
        if (current.getNext() == null) {
            task.setStatus(_STATUS_END);
            // 应该清空缓存中的任务
            TasksController.removeTask(task);
            task.setProcessNode(null);
            return;
        }
        task.setDisplay(current.getNext().getNodeDesc());
        task.setStatus(current.getNext().getNodeStatus());
        task.setProcessNode(current.getNext());
        task.setNode(current.getNext().getNodeName());
        InitiationTaskInfo.initNextProcessNode(current.getNext());
    }
View Full Code Here

     *
     * @return
     */
    public static <T> List<Result> approveProcess(String taskId, T data) {
        Task task = TasksController.getTask(taskId);
        ProcessNode node = task.getProcessNode();
        List<Result> rs = new ArrayList<Result>(3);
        String returnedValue = null;
        Throwable exception = null;
        ProcessData datas = new ProcessData(task, data);
        String nodeName = null;
        do {
            try {
                if (node != null) {
                    nodeName = node.getNodeName();
                    //节点处理类
                    Process nodeProcess = ProcessFactory.getProcess(nodeName);
                    returnedValue = nodeProcess.execute(datas);
                }
                node = task.getProcessNode();
            } catch (AppException ex) {
                exception = ex;
                node = null;
            }
            rs.add(new Result(returnedValue, nodeName, taskId, exception));
            //自动流转节点系统自动完成
            if (node!=null &&!node.isAutoFlag()) {
                break;
            }
        } while (node != null);
        return rs;
    }
View Full Code Here

TOP

Related Classes of cn.com.manager.tasks.node.ProcessNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.