Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #313 +/- ##
=============================================
+ Coverage 50.65% 53.87% +3.22%
- Complexity 80 96 +16
=============================================
Files 40 42 +2
Lines 458 490 +32
Branches 9 11 +2
=============================================
+ Hits 232 264 +32
Misses 221 221
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
2 times, most recently
from
October 31, 2026 23:05
90cb8d1 to
7af1e65
Compare
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
4 times, most recently
from
November 1, 2026 09:48
f4d37ae to
55be009
Compare
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
3 times, most recently
from
November 1, 2026 13:28
8e93ba6 to
a42e4af
Compare
emaarco
marked this pull request as ready for review
November 3, 2026 07:44
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
2 times, most recently
from
November 3, 2026 09:49
2321704 to
05927f4
Compare
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
from
November 3, 2026 10:10
05927f4 to
46ca262
Compare
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
from
November 3, 2026 12:10
8a88734 to
338bd98
Compare
…servers Observers watch the handler via before/after instead of wrapping it, so they cannot veto, repeat or swallow a handler execution. Observer exceptions are only logged; state flows from before to after of the same observer without ThreadLocals. The name avoids confusion with engine listeners such as Camunda ExecutionListener and TaskListener.
The subscription decorator only spanned the handler call, so the delivery's failure handling ran after the observers and its logs lost their trace and MDC context. Deliveries now call TaskHandlerObservation around their whole per-task work and report failed or vanished tasks through a TaskDeliveryReport. Only external tasks are observed.
…ecorator Adapters wrap their whole per-task work, including their failure handling, with TaskExecutionDecorators, in the spirit of Spring's TaskDecorator. A span or MDC entry opened by a decorator thus covers the handler and the delivery's failure logs. The outcome model, the outcome recorder, the decorated completion API and the delivery report are removed, as the tracing use case only needs the scope.
emaarco
force-pushed
the
emaarco/system-instruction-phase-1
branch
from
November 3, 2026 12:17
5fd7a64 to
2534ac2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Applications need a trace span (Micrometer, OpenTelemetry, Elastic APM, ...) per execution of an external service task, so that the logs of the handler, of the
process-engine-workerand of the adapter delivery's failure handling carry the trace id and MDC, plus an optional place to do something before and after an execution (logging, metrics). This must not interfere with the execution or completion of the task. Today, consumers copy whole adapter deliveries to achieve this.The PR evolved in four commits, kept for comparison and to be squashed on merge:
chain.proceed()) around the handler: could veto, repeat or swallow the execution.before/afteraround the subscription action: the delivery's failure handling ran outside their scope, so its logs lost the trace context.This is Phase 1 only: the Spring-free core. Phase 2 updates the CIB seven adapter, which currently serves as the spike.
What
TaskExecutionDecoratortoapi, afun interfacein the spirit of Spring'sTaskDecorator:decorate(task, payload, execution): Runnable.executionis the delivery's whole per-task work, i.e. the handler call and the delivery's own failure handling and logging, so a span or MDC entry opened aroundexecution.run()covers all of it. Decorators receive read-only views of the task information and payload and are not told the outcome.TaskExecutionDecorationtoapi-impl. An adapter builds one instance from the decorators in execution order (e.g. in its starter from the ordered beans), passes it to its deliveries (defaultTaskExecutionDecoration.NONE) and callsrun(task, payload, execution)in every external task delivery. It nests the decorators with the first one outermost and runs the execution exactly once: a decorator that fails indecorate, throws before running the execution, skips it or runs it twice is only logged (PROCESS-ENGINE-API-016/-017/-018), and the execution still runs once. Exceptions of the execution pass through unchanged; errors are not caught. Without decorators it just runs the execution.AbstractTaskSubscriptionApiImpland the completion APIs stay unchanged.docs/task-subscription-api.md, with a tracing/MDC example in Kotlin and a logging example in Java.Verification
./mvnw clean verifypasses.decorate, a decorator throwing before and after the execution, and exceptions and errors of the execution passing through unchanged.Out of scope / Follow-ups
apirelease, starting with CIB seven: build aTaskExecutionDecorationfrom the orderedTaskExecutionDecoratorbeans and call itsrunaround the per-task work of every external task delivery, and put the activity instance id intoTaskInformation.metaunderCommonRestrictions.ACTIVITY_INSTANCE_IDfrom feat(api): add activity instance id to common restrictions #324.failed(...)callback, to mark a span as failed, can be added later as a default method without breaking existing decorators. It depends on Failure handling of task executions is owned by both the worker and the adapter deliveries process-engine-worker#284, because the worker reports failures itself.Observationin the adapter starters.Refs #278