阳光_shenke
2017-09-06 04:27
采纳率: 60%
浏览 3.6k

查询activiti流程定义转换为json抛出的异常

图片说明
请问这个错误如何解决,查询activiti流程定义转换为json抛出的异常

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

9条回答 默认 最新

  • 清雾 2017-09-06 06:26
    已采纳

    图片说明

    打赏 评论
  • cloudyzhao 2017-09-06 05:13

    转换json数组的时候出问题了 贴下代码看看

    打赏 评论
  • qq_31480835 2017-09-06 05:59

    你可以将这个processDefinition属性过滤掉

    打赏 评论
  • 阳光_shenke 2017-09-06 06:07

    图片说明

    打赏 评论
  • qq_23153607 2017-09-06 07:12

    你先看看查出来的数据是什么,打个断点看看。

    打赏 评论
  • qq_27855813 2017-12-22 11:55
    // 查看已部署的流程定义列表
    @RequestMapping(value = "/process-list", method = { RequestMethod.GET, RequestMethod.POST })
    @ResponseBody
    public ResultMsg processList(HttpServletRequest request)
    {
        try
        {
            List<Map<String, Object>> list = new ArrayList<>();
            Map<String, Object> map;
    
            ProcessDefinitionQuery processDefinitionQuery = activitiService.getProcessDefinitionQuery();
            List<ProcessDefinition> processDefinitionList = processDefinitionQuery.list();
    
            for (ProcessDefinition pd : processDefinitionList)
            {
                map = new HashMap<>();
                map.put("processDefinitionId", pd.getId());
                map.put("deploymentId", pd.getDeploymentId());
                map.put("name", pd.getName());
                map.put("key", pd.getKey());
                map.put("version", pd.getVersion());
                map.put("resourceName", pd.getResourceName());
                map.put("diagramResourceName", pd.getDiagramResourceName());
                map.put("deploymentTime", activitiService.getSingleDeployment(pd.getDeploymentId()).getDeploymentTime());
                list.add(map);
            }
            return new ResultMsg(ResultCode.SUCCESS, "获取流程定义列表成功", list);
        }
        catch (Exception e)
        {
            e.printStackTrace();
            return new ResultMsg(ResultCode.SYSTEM_INNER_ERROR, "获取流程定义列表失败", null);
        }
    }
    
    打赏 评论
  • qq_27855813 2017-12-22 11:55

    @Service
    public class ActivitiService
    {
    @Autowired
    RepositoryService repositoryService;

    public ProcessDefinitionQuery getProcessDefinitionQuery()
    {
        return repositoryService.createProcessDefinitionQuery().orderByDeploymentId().desc();
    }
    
    public Deployment getSingleDeployment(String deploymentId)
    {
        return repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
    }
    

    }

    打赏 评论
  • qq_27855813 2017-12-22 11:56

    public class ResultMsg implements Serializable
    {
    private static final long serialVersionUID = 9011311991851772422L;

    private Integer code;
    private String msg;
    private Object data;
    
    public ResultMsg()
    {
    
    }
    
    public ResultMsg(Integer code, String msg, Object data)
    {
        super();
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    
    public Integer getCode()
    {
        return code;
    }
    
    public void setCode(Integer code)
    {
        this.code = code;
    }
    
    public String getMsg()
    {
        return msg;
    }
    
    public void setMsg(String msg)
    {
        this.msg = msg;
    }
    
    public Object getData()
    {
        return data;
    }
    
    public void setData(Object data)
    {
        this.data = data;
    }
    
    @Override
    public String toString()
    {
        return "ResultMsg [code=" + code + ", msg=" + msg + ", data=" + data + "]";
    }
    

    }

    打赏 评论
  • qq_27855813 2017-12-22 11:56

    public class ResultCode
    {
    // 成功状态码
    public static final int SUCCESS = 1;

    // -------------------失败状态码----------------------
    // 参数错误
    public static final int PARAMS_IS_NULL = 10001;// 参数为空
    public static final int PARAMS_NOT_COMPLETE = 10002; // 参数不全
    public static final int PARAMS_TYPE_ERROR = 1003; // 参数类型错误
    public static final int PARAMS_IS_INVALID = 10004; // 参数无效
    
    // 用户错误
    public static final int USER_NOT_EXIST = 20001; // 用户不存在
    public static final int USER_NOT_LOGGED_IN = 20002; // 用户未登陆
    public static final int USER_ACCOUNT_ERROR = 20003; // 用户名或密码错误
    public static final int USER_ACCOUNT_FORBIDDEN = 20004; // 用户账户已被禁用
    public static final int USER_HAS_EXIST = 20005;// 用户已存在
    
    // 业务错误
    public static final int BUSINESS_ERROR = 30001;// 系统业务出现问题
    
    // 系统错误
    public static final int SYSTEM_INNER_ERROR = 40001; // 系统内部错误
    
    // 数据错误
    public static final int DATA_NOT_FOUND = 50001; // 数据未找到
    public static final int DATA_IS_WRONG = 50002;// 数据有误
    public static final int DATA_ALREADY_EXISTED = 50003;// 数据已存在
    
    // 接口错误
    public static final int INTERFACE_INNER_INVOKE_ERROR = 60001; // 系统内部接口调用异常
    public static final int INTERFACE_OUTER_INVOKE_ERROR = 60002;// 系统外部接口调用异常
    public static final int INTERFACE_FORBIDDEN = 60003;// 接口禁止访问
    public static final int INTERFACE_ADDRESS_INVALID = 60004;// 接口地址无效
    public static final int INTERFACE_REQUEST_TIMEOUT = 60005;// 接口请求超时
    public static final int INTERFACE_EXCEED_LOAD = 60006;// 接口负载过高
    
    // 权限错误
    public static final int PERMISSION_NO_ACCESS = 70001;// 没有访问权限
    

    }

    打赏 评论

相关推荐 更多相似问题