protected VelocityContext createVelocityContext ( ) throws ActivityException { try { VelocityContext context = null ; String toolboxFile = getAttributeValueSmart ( VELOCITY_TOOLBOX_FILE ) ; if ( toolboxFile != null && FileHelper . fileExistsOnClasspath ( toolboxFile ) ) { throw new ActivityException ( "TODO: Velocity Toolbox Support" ) ; // XMLToolboxManager toolboxManager = new XMLToolboxManager(); // toolboxManager.load(FileHelper.fileInputStreamFromClasspath(toolboxFile)); // context = new VelocityContext(toolboxManager.getToolbox(toolboxFile)); } else { context = new VelocityContext ( ) ; } Process processVO = getMainProcessDefinition ( ) ; List < Variable > varVOs = processVO . getVariables ( ) ; for ( Variable variableVO : varVOs ) { String variableName = variableVO . getName ( ) ; Object variableValue = getVariableValue ( variableName ) ; context . put ( variableName , variableValue ) ; } return context ; } catch ( Exception ex ) { throw new ActivityException ( - 1 , ex . getMessage ( ) , ex ) ; } }
Creates the velocity context adding process variables as parameters .