AnsweredAssumed Answered

Getting List of Known Process Types

Question asked by dcmccain on Sep 21, 2016
I am using Activiti with Java/Spring-boot to implement a rest service. I attempted to use the following code to get a list of all known Process Models with no success. The run time environment starts fine and other functions work correctly, so I know Activiti is aware of the Models. Any insight would be helpful. The code runs without error but returns no results. Using other methods, I have verified that Process with tasks are active.

   public ArrayNode getProcessTypes(){
       init();
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        RepositoryService repoService = processEngine.getRepositoryService();
        List<Model> mdlLst = repoService.createModelQuery().list();
       ObjectMapper mapper = new ObjectMapper();
       ArrayNode models = mapper.createArrayNode();
       for(Model mdl:mdlLst){
          ObjectNode mdlObj = mapper.createObjectNode();
          mdlObj.put("DeploymentID", mdl.getDeploymentId());
          mdlObj.put("Id", mdl.getId());
          mdlObj.put("Name", mdl.getName());
          mdlObj.put("MetaInfo", mdl.getMetaInfo());
          models.add(mdlObj);
       }
        return models;

Outcomes