public void setVariable(String name, Object value) { VariableScope variableScope = (VariableScope) ((ContextContainer) getProcess()).getDefaultContext( VariableScope.VARIABLE_SCOPE ); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) getContextInstance(VariableScope.VARIABLE_SCOPE); if (variableScopeInstance == null) { throw new IllegalArgumentException("No variable scope found."); } variableScope.validateVariable(getProcessName(), name, value); variableScopeInstance.setVariable(name, value); }
when(processInstance.getProcessId()).thenReturn("myprocess"); when(processInstance.getDescription()).thenReturn(""); when(processInstance.getProcessName()).thenReturn("MyProcess"); when(processInstance.getState()).thenReturn(1); when(processInstance.getVariables()).thenReturn(variables);
when(processInstance.getProcessId()).thenReturn("myprocess"); when(processInstance.getDescription()).thenReturn(""); when(processInstance.getProcessName()).thenReturn("MyProcess"); when(processInstance.getState()).thenReturn(1); when(processInstance.getVariables()).thenReturn(variables);
public void setVariable(String name, Object value) { VariableScope variableScope = (VariableScope) ((ContextContainer) getProcess()).getDefaultContext( VariableScope.VARIABLE_SCOPE ); VariableScopeInstance variableScopeInstance = (VariableScopeInstance) getContextInstance(VariableScope.VARIABLE_SCOPE); if (variableScopeInstance == null) { throw new IllegalArgumentException("No variable scope found."); } variableScope.validateVariable(getProcessName(), name, value); variableScopeInstance.setVariable(name, value); }