Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2012-2015, Inc. or its affiliates. All Rights Reserved.
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
 * or in the "license" file accompanying this file. This file is distributed
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
Holds DecisionContext for currently executing decision task. Do not use this class directly. Instead use
public abstract class CurrentDecisionContext {
    private final static WorkflowExecutionLocal<DecisionContextCURRENT = new WorkflowExecutionLocal<DecisionContext>();

retrieves the current DecisionContext for a particular thread

current decider context being used for the decision
java.lang.IllegalStateException if this method is called outside the scope of workflow definition.
    public static DecisionContext get() {
        DecisionContext result = .get();
        if (result == null) {
            throw new IllegalStateException(
                    "No context found. It means that the method is called outside of the workflow definition code.");
        return result;


if context is set which means that code is executed as part of the decision.
    public static boolean isSet() {
        return .get() != null;
    public static void set(DecisionContext context) {
        if (context == null) {
            throw new IllegalArgumentException("null context");
    public static void unset() {
New to GrepCode? Check out our FAQ X