use of org.wso2.carbon.bpmn.core.integration.BPSGroupManagerFactory in project carbon-business-process by wso2.
the class BPMNOSGIService method getGroupIdentityManager.
public static BPSGroupIdentityManager getGroupIdentityManager() {
ProcessEngineImpl processEngine = (ProcessEngineImpl) getBPMNEngineService().getProcessEngine();
ProcessEngineConfigurationImpl processEngineConfigurationImpl = null;
if (processEngine != null) {
processEngineConfigurationImpl = processEngine.getProcessEngineConfiguration();
if (processEngineConfigurationImpl != null) {
BPSGroupIdentityManager bpsGroupIdentityManager = null;
if (processEngineConfigurationImpl.getSessionFactories() != null) {
BPSGroupManagerFactory bpsGroupManagerFactory = (BPSGroupManagerFactory) processEngineConfigurationImpl.getSessionFactories().get(GroupIdentityManager.class);
return (BPSGroupIdentityManager) bpsGroupManagerFactory.openSession();
}
}
}
throw new BPMNOSGIServiceException("Business Process Server Group manager couldn't be identified");
}
use of org.wso2.carbon.bpmn.core.integration.BPSGroupManagerFactory in project carbon-business-process by wso2.
the class ActivitiEngineBuilder method buildEngine.
/* Instantiates the engine. Builds the state of the engine
*
* @return ProcessEngineImpl object
* @throws BPSFault Throws in the event of failure of ProcessEngine
*/
public ProcessEngine buildEngine() throws BPSFault {
try {
String carbonConfigDirPath = CarbonUtils.getCarbonConfigDirPath();
String activitiConfigPath = carbonConfigDirPath + File.separator + BPMNConstants.ACTIVITI_CONFIGURATION_FILE_NAME;
File activitiConfigFile = new File(activitiConfigPath);
ProcessEngineConfigurationImpl processEngineConfigurationImpl = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(new FileInputStream(activitiConfigFile));
// Add script engine resolvers
setResolverFactories(processEngineConfigurationImpl);
// Add supported variable types
setSupportedVariableTypes(processEngineConfigurationImpl);
// we have to build the process engine first to initialize session factories.
processEngine = processEngineConfigurationImpl.buildProcessEngine();
processEngineConfigurationImpl.getSessionFactories().put(UserIdentityManager.class, new BPSUserManagerFactory());
processEngineConfigurationImpl.getSessionFactories().put(GroupIdentityManager.class, new BPSGroupManagerFactory());
dataSourceJndiName = processEngineConfigurationImpl.getProcessEngineConfiguration().getDataSourceJndiName();
} catch (FileNotFoundException e) {
String msg = "Failed to create an Activiti engine. Activiti configuration file not found";
throw new BPSFault(msg, e);
}
return processEngine;
}
Aggregations