// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// @SuppressWarnings({"unchecked"})
// public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//     return (T) getStrategy().getDescriptor();
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// public final class FlowInstanceDescriptorHolder implements Serializable{
//     private static final long serialVersionUID = 969547478248429191L;
//     private static final String STRATEGY_THREADLOCAL = "threadlocal";
//     private static Map<String, FlowInstanceDescriptorHolderStrategy> strategies;
//     private static String currentStrategy;
// 
//     static {
//         strategies = new HashMap<String, FlowInstanceDescriptorHolderStrategy>();
//         strategies.put(STRATEGY_THREADLOCAL, new ThreadLocalFlowInstanceDescriptorHolderStrategy());
//         currentStrategy = STRATEGY_THREADLOCAL;
//     }
// 
//     private static FlowInstanceDescriptorHolderStrategy getStrategy() {
//         return strategies.get(currentStrategy);
//     }
// 
//     public static void setStrategy(String strategy) {
//         Assert.notNull(currentStrategy, "The 'currentStrategy' argument must not be null.");
//         currentStrategy = strategy;
//     }
// 
//     @SuppressWarnings({"unchecked"})
//     public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//         return (T) getStrategy().getDescriptor();
//     }
// 
//     public static void setFlowInstanceDescriptor(FlowInstanceDescriptor descriptor) {
//         getStrategy().setDescriptor(descriptor);
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/TransitionActionContext.java
// public final class TransitionActionContext implements Serializable{
//     private static final long serialVersionUID = -2438974871913081078L;
//     private String targetStateId;
//     private Object[] arguments;
// 
//     public TransitionActionContext(String targetStateId, Object[] arguments) {
//         this.targetStateId = targetStateId;
//         this.arguments = arguments;
//     }
// 
//     public Object[] getArguments() {
//         return arguments;
//     }
// 
//     public String getTargetStateId() {
//         return targetStateId;
//     }
// 
//     public void setTargetStateId(String targetStateId) {
//         this.targetStateId = targetStateId;
//     }
// }


import static org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder.getFlowInstanceDescriptor;
import static org.springframework.util.Assert.notNull;
import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.PropertyAccessor;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.extensions.workflow.annotation.Descriptor;
import org.springframework.extensions.workflow.annotation.DescriptorProperty;
import org.springframework.extensions.workflow.annotation.ReturnsState;
import org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder;
import org.springframework.extensions.workflow.context.TransitionActionContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

                    if (propertyName == null) {
                        throw new IllegalStateException(
                                "Unable to get property name for target " + target +
                                " and method" + method
                        );
                    }

                    Object propertyValue;

                    try {
                        PropertyAccessor accessor = new DirectFieldAccessor(getFlowInstanceDescriptor());

                        propertyValue = accessor.getPropertyValue(propertyName);
                    } catch (BeansException e) {
                        throw new IllegalStateException("Unable to get property value", e);
                    }

                    arguments.add(propertyValue);

                    break;
                }
            }

            if (!fromDescriptor) {
                arguments.add(actionContext.getArguments()[fromContext]);
                fromContext++;
            }
        }

// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// @SuppressWarnings({"unchecked"})
// public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//     return (T) getStrategy().getDescriptor();
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// public final class FlowInstanceDescriptorHolder implements Serializable{
//     private static final long serialVersionUID = 969547478248429191L;
//     private static final String STRATEGY_THREADLOCAL = "threadlocal";
//     private static Map<String, FlowInstanceDescriptorHolderStrategy> strategies;
//     private static String currentStrategy;
// 
//     static {
//         strategies = new HashMap<String, FlowInstanceDescriptorHolderStrategy>();
//         strategies.put(STRATEGY_THREADLOCAL, new ThreadLocalFlowInstanceDescriptorHolderStrategy());
//         currentStrategy = STRATEGY_THREADLOCAL;
//     }
// 
//     private static FlowInstanceDescriptorHolderStrategy getStrategy() {
//         return strategies.get(currentStrategy);
//     }
// 
//     public static void setStrategy(String strategy) {
//         Assert.notNull(currentStrategy, "The 'currentStrategy' argument must not be null.");
//         currentStrategy = strategy;
//     }
// 
//     @SuppressWarnings({"unchecked"})
//     public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//         return (T) getStrategy().getDescriptor();
//     }
// 
//     public static void setFlowInstanceDescriptor(FlowInstanceDescriptor descriptor) {
//         getStrategy().setDescriptor(descriptor);
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/TransitionActionContext.java
// public final class TransitionActionContext implements Serializable{
//     private static final long serialVersionUID = -2438974871913081078L;
//     private String targetStateId;
//     private Object[] arguments;
// 
//     public TransitionActionContext(String targetStateId, Object[] arguments) {
//         this.targetStateId = targetStateId;
//         this.arguments = arguments;
//     }
// 
//     public Object[] getArguments() {
//         return arguments;
//     }
// 
//     public String getTargetStateId() {
//         return targetStateId;
//     }
// 
//     public void setTargetStateId(String targetStateId) {
//         this.targetStateId = targetStateId;
//     }
// }


// Path: src/main/java/org/springframework/extensions/workflow/support/TransitionMethodInvoker.java
import static org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder.getFlowInstanceDescriptor;
import static org.springframework.util.Assert.notNull;
import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.PropertyAccessor;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.extensions.workflow.annotation.Descriptor;
import org.springframework.extensions.workflow.annotation.DescriptorProperty;
import org.springframework.extensions.workflow.annotation.ReturnsState;
import org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder;
import org.springframework.extensions.workflow.context.TransitionActionContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


                    if (propertyName == null) {
                        throw new IllegalStateException(
                                "Unable to get property name for target " + target +
                                " and method" + method
                        );
                    }

                    Object propertyValue;

                    try {
                        PropertyAccessor accessor = new DirectFieldAccessor(getFlowInstanceDescriptor());

                        propertyValue = accessor.getPropertyValue(propertyName);
                    } catch (BeansException e) {
                        throw new IllegalStateException("Unable to get property value", e);
                    }

                    arguments.add(propertyValue);

                    break;
                }
            }

            if (!fromDescriptor) {
                arguments.add(actionContext.getArguments()[fromContext]);
                fromContext++;
            }
        }

        method.setAccessible(true); // Set accessible for invokation