Skip to content

Commit

Permalink
reduced logging
Browse files Browse the repository at this point in the history
Issue #823
  • Loading branch information
rsoika committed Sep 4, 2024
1 parent e8d0ead commit 0d63bf3
Showing 1 changed file with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,15 @@ public ItemCollection loadTask(ItemCollection workitem) throws ModelException {
public ItemCollection loadEvent(ItemCollection workitem) throws ModelException {

BPMNModel model = findModelByWorkitem(workitem);
logger.info("...loadEvent " + workitem.getTaskID() + "." + workitem.getEventID());
// logger.info("...loadEvent " + workitem.getTaskID() + "." +
// workitem.getEventID());
ItemCollection event = findEventByID(model, workitem.getTaskID(), workitem.getEventID());
// verify if the event is a valid processing event?
if (event != null) {
List<ItemCollection> allowedEvents = findEventsByTask(model, workitem.getTaskID());
boolean found = false;
for (ItemCollection allowedEvent : allowedEvents) {
logger.info("verify event : " + allowedEvent.getItemValueString("id"));
// logger.info("verify event : " + allowedEvent.getItemValueString("id"));
if (allowedEvent.getItemValueString("id").equals(event.getItemValueString("id"))) {
found = true;
break;
Expand Down Expand Up @@ -700,21 +701,9 @@ public List<ItemCollection> findEventsByTask(final BPMNModel model, int taskID)
}
// next we also add all initEvent nodes
List<BPMNElementNode> initEventNodes = findInitEventNodes(taskElement);

logger.info("Final Result of findInitEventNodes:");
for (BPMNElementNode e : initEventNodes) {
logger.info(" " + e.getId());
}

for (BPMNElementNode element : initEventNodes) {
result.add(BPMNEntityBuilder.build(element));
}
// result.addAll(initEventNodes);

logger.info("Final Result of findEventsByTask:");
for (ItemCollection e : result) {
logger.info(" " + e.getItemValueString("id"));
}
return result;
}

Expand Down Expand Up @@ -865,7 +854,6 @@ private ItemCollection lookupDefinition(final BPMNModel model) {
* @return
*/
private Activity lookupTaskElementByID(final BPMNModel model, int taskID) {
long l = System.currentTimeMillis();
Set<Activity> activities = model.findAllActivities();
// filter the imixs activity with the corresponding id
for (Activity activity : activities) {
Expand Down Expand Up @@ -1011,27 +999,22 @@ private Event lookupEventElementByID(final BPMNModel model, int taskID, int even
*/
private List<BPMNElementNode> findInitEventNodes(BPMNElementNode currentNode) {
List<BPMNElementNode> collector = new ArrayList<>();
logger.info("findInitEventNodes for element " + currentNode.getId() + " type=" + currentNode.getType());
// logger.info("findInitEventNodes for element " + currentNode.getId() + "
// type=" + currentNode.getType());
Set<SequenceFlow> flowSet = currentNode.getIngoingSequenceFlows();
for (SequenceFlow flow : flowSet) {
BPMNElementNode element = flow.getSourceElement();
logger.info("verify element " + element.getId() + " type=" + element.getType());
// logger.info("verify element " + element.getId() + " type=" +
// element.getType());
if (BPMNUtil.isInitEventNode(element)) {
// collector.add(BPMNEntityBuilder.build(element));
collector.add(element);
// collector.add((Event) element);
} else if (element != null && BPMNUtil.isImixsEventElement(element)) {
// is the source an Imixs event node?
// recursive call....
List<BPMNElementNode> subResult = findInitEventNodes(element);
collector.addAll(subResult);
}
}

logger.info("Result of findInitEventNodes:");
for (BPMNElementNode e : collector) {
logger.info(" " + e.getId());
}
return collector;
}
}

0 comments on commit 0d63bf3

Please sign in to comment.