Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Sep 6, 2024
1 parent 41a49d8 commit 9727905
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Dockerfile-wildfly-debug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/wildfly/wildfly:27.0.1.Final-jdk11
FROM quay.io/wildfly/wildfly:27.0.1.Final-jdk17

LABEL description="Imixs-Process-Manager"
LABEL maintainer="ralph.soika@imixs.com"
Expand Down
32 changes: 14 additions & 18 deletions src/main/java/org/imixs/application/model/ModelController.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public Set<String> getGroups(String version) {
try {
BPMNModel model;
model = modelService.getModelManager().getModel(version);
return modelService.getModelManager().findAllGroups(model);
return modelService.getModelManager().findAllGroupsByModel(model);
} catch (ModelException e) {
logger.log(Level.WARNING, "Unable to load groups:{0}", e.getMessage());
}
Expand All @@ -123,20 +123,18 @@ public Set<String> getGroups(String version) {
* The worflowGroup list is used to assign a workflow Group to a core process.
*
* @return list of workflow groups
* @throws ModelException
*/
public List<String> getWorkflowGroups() {
public List<String> getWorkflowGroups() throws ModelException {

// Set<String> set = new HashSet<>();
// List<String> versions = modelService.getModelManager().getVersions();
List<String> result = new ArrayList<>();

for (BPMNModel model : modelService.getModelManager().getAllModels()) {
String version = BPMNUtil.getVersion(model);
// Skip system model..
if (version.startsWith("system-")) {
continue;
}
Set<String> groups = modelService.getModelManager().findAllGroups(model);
Set<String> groups = modelService.getModelManager().findAllGroupsByModel(model);
for (String groupName : groups) {
if (result.contains(groupName))
continue;
Expand Down Expand Up @@ -173,15 +171,12 @@ public ItemCollection findStartTaskByGroup(String version, String group) throws
ItemCollection result = null;
BPMNModel model = modelService.getModelManager().getModel(version);
List<ItemCollection> startTasks;
try {
startTasks = modelService.getModelManager().findStartTasks(model, group);
if (startTasks.size() > 0) {
result = startTasks.get(0);
}
} catch (BPMNModelException e) {
throw new ModelException(ModelException.INVALID_MODEL,
"Unable to create new workitem by group '" + group + "'", e);

startTasks = modelService.getModelManager().findStartTasks(model, group);
if (startTasks.size() > 0) {
result = startTasks.get(0);
}

if (result == null) {
logger.warning("No Model found for Group '" + group + "'");
}
Expand Down Expand Up @@ -211,12 +206,14 @@ public ItemCollection startWorkflowByTask(String version, ItemCollection startTa
}

/**
* returns all model versions. Used by the Model View
* Returns a sorted set of all model versions.
* <p>
* Used by the Model View.
*
* @return
*/
public List<String> getVersions() {
return modelService.getModelManager().getVersions();
public Set<String> getVersions() {
return modelService.getModelEntityStore().keySet();
}

/**
Expand Down Expand Up @@ -257,7 +254,6 @@ public void doUploadModel(ActionEvent event)
BPMNModel model;
try {
model = BPMNModelFactory.read(inputStream);

modelService.saveModel(model);
continue;
} catch (BPMNModelException e) {
Expand Down

0 comments on commit 9727905

Please sign in to comment.