private void loadWorkItems(String location) { String content = ConfFileUtils.URLContentsToString( ConfFileUtils.getURL( location, null, RuleBaseConfiguration.class ) ); try { this.workDefinitions.addAll( (List<Map<String, Object>>) MVEL.eval( content, new HashMap() ) ); } catch ( Throwable t ) { logger.error("Error occurred while loading work definitions " + location + "\nContinuing without reading these work definitions", t); throw new RuntimeException( "Could not parse work definitions " + location + ": " + t.getMessage() ); } }
public void loadSemanticModule(String moduleLocation) { URL url = ConfFileUtils.getURL( moduleLocation, this.classLoader, getClass() ); if ( url == null ) { throw new IllegalArgumentException( moduleLocation + " is specified but cannot be found.'" ); } Properties properties = ConfFileUtils.getProperties( url ); if ( properties == null ) { throw new IllegalArgumentException( moduleLocation + " is specified but cannot be found.'" ); } loadSemanticModule( properties ); }
@SuppressWarnings("unchecked") private void loadWorkItemHandlers(String location, Map<String, Object> params) { String content = ConfFileUtils.URLContentsToString( ConfFileUtils.getURL( location, null, RuleBaseConfiguration.class ) ); Map<String, WorkItemHandler> workItemHandlers = (Map<String, WorkItemHandler>) MVEL.eval( content, params ); this.workItemHandlers.putAll( workItemHandlers ); }