Search in sources :

Example 1 with TaskContext

use of com.walmartlabs.concord.runtime.v2.runner.context.TaskContext in project concord by walmartlabs.

the class TaskV2Provider method createTask.

@Override
public Task createTask(Context ctx, String key) {
    Class<? extends Task> klass = holder.get(key);
    if (klass == null) {
        return null;
    }
    Map<String, Object> defaultVariables = defaultTaskVariables.get(key);
    TaskContext taskContext = new TaskContext(ctx, new MapBackedVariables(defaultVariables));
    return ContextProvider.withContext(taskContext, () -> injector.getInstance(klass));
}
Also used : MapBackedVariables(com.walmartlabs.concord.runtime.v2.sdk.MapBackedVariables) TaskContext(com.walmartlabs.concord.runtime.v2.runner.context.TaskContext)

Aggregations

TaskContext (com.walmartlabs.concord.runtime.v2.runner.context.TaskContext)1 MapBackedVariables (com.walmartlabs.concord.runtime.v2.sdk.MapBackedVariables)1