Search in sources :

Example 6 with ThreadId

use of com.walmartlabs.concord.svm.ThreadId in project concord by walmartlabs.

the class ContextVariables method set.

@Override
public void set(String key, Object value) {
    TaskProviders providers = ctx.execution().runtime().getService(TaskProviders.class);
    if (providers.hasTask(key)) {
        log.warn("Local variable '{}' shadows a task. This may cause issues calling '{}' task in expressions. " + "Avoid using same names for tasks and variables.", key, key);
    }
    ThreadId threadId = ctx.execution().currentThreadId();
    State state = ctx.execution().state();
    VMUtils.putLocal(state, threadId, key, value);
}
Also used : ThreadId(com.walmartlabs.concord.svm.ThreadId) TaskProviders(com.walmartlabs.concord.runtime.v2.runner.tasks.TaskProviders) State(com.walmartlabs.concord.svm.State)

Aggregations

State (com.walmartlabs.concord.svm.State)6 ThreadId (com.walmartlabs.concord.svm.ThreadId)6 Frame (com.walmartlabs.concord.svm.Frame)2 TaskProviders (com.walmartlabs.concord.runtime.v2.runner.tasks.TaskProviders)1 InMemoryState (com.walmartlabs.concord.svm.InMemoryState)1 Serializable (java.io.Serializable)1 Test (org.junit.jupiter.api.Test)1