Search in sources :

Example 1 with LogContext

use of com.walmartlabs.concord.runtime.v2.runner.logging.LogContext in project concord by walmartlabs.

the class StepCommand method eval.

@Override
public void eval(Runtime runtime, State state, ThreadId threadId) {
    ContextFactory contextFactory = runtime.getService(ContextFactory.class);
    T step = getStep();
    UUID correlationId = getCorrelationId();
    Context ctx = contextFactory.create(runtime, state, threadId, step, correlationId);
    LogContext logContext = getLogContext(runtime, ctx, correlationId);
    if (logContext == null) {
        executeWithContext(ctx, runtime, state, threadId);
    } else {
        runtime.getService(RunnerLogger.class).withContext(logContext, () -> executeWithContext(ctx, runtime, state, threadId));
    }
}
Also used : ContextFactory(com.walmartlabs.concord.runtime.v2.runner.context.ContextFactory) LogContext(com.walmartlabs.concord.runtime.v2.runner.logging.LogContext) Context(com.walmartlabs.concord.runtime.v2.sdk.Context) LogContext(com.walmartlabs.concord.runtime.v2.runner.logging.LogContext) UUID(java.util.UUID) RunnerLogger(com.walmartlabs.concord.runtime.v2.runner.logging.RunnerLogger)

Aggregations

ContextFactory (com.walmartlabs.concord.runtime.v2.runner.context.ContextFactory)1 LogContext (com.walmartlabs.concord.runtime.v2.runner.logging.LogContext)1 RunnerLogger (com.walmartlabs.concord.runtime.v2.runner.logging.RunnerLogger)1 Context (com.walmartlabs.concord.runtime.v2.sdk.Context)1 UUID (java.util.UUID)1