Iterating active executions/activities right after the process engine starts

Thanks, @thorben!

Unfortunately I can’t find out how do I get the extension property out of an ActivityInstance object?

The other problem of mine is that I already have a code that decides where to put a listener based on the type of event catching; for the boundary types and for those before event gateways it is put to the parent object rather then to a catching element itself (as discussed here). So looking to all leaf activity instances, if I am guessing right, is complicating and duplicating the logic I already have. I would if it were the last problem, but another one is…

I need to resolve expressions from the extension elements. Will I be able to do this? My notify method does that easily. Everything pushes me to just call it when I need to restart my services.

Secretly I’d wish to share some of it. This is a part of the listener plugin. We have to resolve several custom attributes, one is “uri”, and another is “recipient”:

       new ServiceStartListener() {
                @Override
                public void notify(ActivityExecution exec) throws Exception {
                    _LOG.debug("Intermediate Catch Message notifying START with uri {} in activity {}...", new Object[]{uriEl, exec.getId()});
                    final ELContext elcontext = _expressionManager.getElContext(exec);
                    ValueExpression ve = _expressionManager.createValueExpression(uriEl);
                    final String uri = (String) ve.getValue(elcontext);

                    final RecipientIdentifier recipient;
                    String el = element.attributeNS(REXNAMESPACE, "recipient");
                    if (el != null && el.trim().length() > 0) {
                        ve = _expressionManager.createValueExpression(el);
                        Object recObj = ve.getValue(elcontext);
           .................... etc etc
                        }
                    }

                    _startConsumerService(uri, messageName, exec.getId(), recipient);
                    _LOG.debug("Intermediate Catch Message notified START with uri {} in activity {}", new Object[]{uriEl, exec.getId()});
                }
            });

It seems hard for me to rip this out of a listener :cry: