/** * initializes the workflow and a default config * * @return the unique workflow id */ private long createWorkflow() throws InvalidRoleException, InvalidInputException, WorkflowException { this.osWorkflowInstance = new BasicWorkflow(this.caller); DefaultConfiguration config = new DefaultConfiguration(); this.osWorkflowInstance.setConfiguration(config); long wfId = this.osWorkflowInstance.initialize(this.osWorkflowName, this.action, this.map); return wfId; }
@Override public Configuration get() { try { final Configuration configuration = new DefaultConfiguration(); configuration.load(ClassLoaderUtils.getResource("osworkflow.xml", getClass())); // This is here because there is a concurrency bug in osworkflow such that the configuration // does not safely initialize its GenericDelegator. If we do not "prime" the reference to the // delegator then you can run into issues where you get a null pointer when concurrently trying // to create issues. DO NOT REMOVE THIS BLOCK OF CODE!! try { configuration.getWorkflowStore(); return configuration; } catch (StoreException e) { throw new DataAccessException(e); } } catch (FactoryException e) { log.error("Error loading OSWorkflow Configuration: " + e, e); throw new InfrastructureException("Error loading osworkflow.xml file: " + e, e); } } }