Globals globals = context.getKieRuntime().getGlobals();
public void execute(ProcessContext context) throws Exception { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.put("kcontext", context); // insert globals into context Globals globals = context.getKieRuntime().getGlobals(); if (globals != null && globals.getGlobalKeys() != null) { for (String gKey : globals.getGlobalKeys()) { engine.put(gKey, globals.get(gKey)); } } if (context.getProcessInstance() != null && context.getProcessInstance().getProcess() != null) { // insert process variables VariableScopeInstance variableScope = (VariableScopeInstance) ((WorkflowProcessInstance)context.getProcessInstance()) .getContextInstance(VariableScope.VARIABLE_SCOPE); Map<String, Object> variables = variableScope.getVariables(); if (variables != null ) { for (Entry<String, Object> variable : variables.entrySet()) { engine.put(variable.getKey(), variable.getValue()); } } } engine.eval(expr); }
Globals globals = context.getKieRuntime().getGlobals(); DMNRuntime runtime = ((KieSession) context.getKieRuntime()).getKieRuntime(DMNRuntime.class); List<FEELProfile> profiles = (List)((DMNRuntimeImpl) runtime).getProfiles(); FEEL feel = FEEL.newInstance(runtime.getRootClassLoader(), profiles);
InternalWorkingMemory internalWorkingMemory = (InternalWorkingMemory) context.getKieRuntime(); (GlobalResolver) context.getKieRuntime().getGlobals() );
InternalWorkingMemory internalWorkingMemory = (InternalWorkingMemory) context.getKieRuntime(); (GlobalResolver) context.getKieRuntime().getGlobals() ); KiePackage pkg = context.getKieRuntime().getKieBase().getKiePackage("MAIN"); if ( pkg instanceof KnowledgePackageImpl) { MVELDialectRuntimeData data = ( MVELDialectRuntimeData ) ((KnowledgePackageImpl) pkg).getDialectRuntimeRegistry().getDialectData( id );
Globals globals = context.getKieRuntime().getGlobals();
public void execute(ProcessContext context) throws Exception { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.put("kcontext", context); // insert globals into context Globals globals = context.getKieRuntime().getGlobals(); if (globals != null && globals.getGlobalKeys() != null) { for (String gKey : globals.getGlobalKeys()) { engine.put(gKey, globals.get(gKey)); } } if (context.getProcessInstance() != null && context.getProcessInstance().getProcess() != null) { // insert process variables VariableScopeInstance variableScope = (VariableScopeInstance) ((WorkflowProcessInstance)context.getProcessInstance()) .getContextInstance(VariableScope.VARIABLE_SCOPE); Map<String, Object> variables = variableScope.getVariables(); if (variables != null ) { for (Entry<String, Object> variable : variables.entrySet()) { engine.put(variable.getKey(), variable.getValue()); } } } engine.eval(expr); }
Globals globals = context.getKieRuntime().getGlobals(); DMNRuntime runtime = ((KieSession) context.getKieRuntime()).getKieRuntime(DMNRuntime.class); List<FEELProfile> profiles = (List)((DMNRuntimeImpl) runtime).getProfiles(); FEEL feel = FEEL.newInstance(runtime.getRootClassLoader(), profiles);
InternalWorkingMemory internalWorkingMemory = (InternalWorkingMemory) context.getKieRuntime(); (GlobalResolver) context.getKieRuntime().getGlobals() ); KiePackage pkg = context.getKieRuntime().getKieBase().getKiePackage("MAIN"); if ( pkg instanceof KnowledgePackageImpl) { MVELDialectRuntimeData data = ( MVELDialectRuntimeData ) ((KnowledgePackageImpl) pkg).getDialectRuntimeRegistry().getDialectData( id );
InternalWorkingMemory internalWorkingMemory = (InternalWorkingMemory) context.getKieRuntime(); (GlobalResolver) context.getKieRuntime().getGlobals() );