Skip to content

Commit

Permalink
changed interface type getVersions
Browse files Browse the repository at this point in the history
Issue #823
  • Loading branch information
rsoika committed Aug 31, 2024
1 parent cfe3f45 commit f7f55ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

package org.imixs.workflow;

import java.util.List;

import org.imixs.workflow.exceptions.ModelException;
import org.openbpmn.bpmn.BPMNModel;

Expand Down Expand Up @@ -66,6 +68,13 @@ public interface ModelManager {
*/
public BPMNModel getModel(String version) throws ModelException;

/**
* Returns a sorted String list of all stored model versions
*
* @return sorted string list of versions
*/
public List<String> getVersions();

/**
* Returns a BPMNModel by a workItem. The workitem must at least provide the
* item '$modelversion' or '$workflowgroup' to resolve the model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,13 @@ public ItemCollection nextModelElement(ItemCollection event, ItemCollection work
*
* @return
*/
public Set<String> getVersions() {
return modelStore.keySet();
public List<String> getVersions() {
Set<String> versions = modelStore.keySet();
// convert to List
List<String> result = new ArrayList<>();
result.addAll(versions);
Collections.sort(result);
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ public BPMNModel getModelByWorkitem(ItemCollection workitem) throws ModelExcepti
*
* @return
*/
@SuppressWarnings("unchecked")
@Override
public List<String> getVersions() {
return (List<String>) openBPMNModelManager.getVersions();
return openBPMNModelManager.getVersions();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public void startup() {
logger.info(" ____ _");
logger.info(" / _/_ _ (_)_ __ ___ Workflow");
logger.info(" _/ // ' \\/ /\\ \\ /(_-< Engine");
logger.info("/___/_/_/_/_//_\\_\\/___/ V6.0");
logger.info("/___/_/_/_/_//_\\_\\/___/ V6.1");
logger.info("");

logger.info("...initalizing models...");
logger.info("...initializing models...");

// first we scan for default models
List<String> models = modelService.getVersions();
Expand Down

0 comments on commit f7f55ee

Please sign in to comment.