String storeFactoryClass = context.findFactoryClass(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_FACTORY_STORE);
if (storeFactoryClass != null)
{
env.put(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_FACTORY_STORE, storeFactoryClass);
}
DatabaseFactory dbFactory = DatabaseFactory.newInstance(env);
env.clear();
Store userStore = context.findStore(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_USER);
if (userStore == null)
{
userStore = WorkflowProperties.getUserStore();
}
env.put(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_USER, userStore);
userDatabase = dbFactory.newUserDatabase(env);
env.clear();
userDatabase.setWorkflowService(context);
Store caseStore = context.findStore(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_CASE);
if (caseStore == null)
{
caseStore = WorkflowProperties.getCaseStore();
}
env.put(org.huihoo.workflow.xpdl.parser.Constants.WORKFLOW_STORE_CASE, caseStore);
caseDatabase = dbFactory.newCaseDatabase(env);
caseDatabase.setWorkflowService(context);
SchemaContext schemaContext = new SchemaContext(schemaConextBase);
if (userDatabase.getSchemaContext() == null)
{
userDatabase.setSchemaContext(schemaContext);