Hello Everyone,
I want to create custom beans in Alfresco Process Service 1.9, for that i'm following the Spring Beans | Alfresco Documentation. As per this i have create one java class which is registered as bean and having one method that called in APS service task's expression.
but i got an error while starting process :
org.activiti.engine.ActivitiException: Unknown property used in expression: ${helloWorldBean.sayHello(execution)}
...
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'helloWorldBean'
...
It will be really helpful if someone will let me know what kind of configuration is missing. Also just wanted to confirm that I've added my project's exported jar into "/alfresco/process-services-1.9.0/tomcat/webapps/activiti-app/WEB-INF/lib". Correct me if this is not the desired folder path to add the project jar file.
best regards,
Manish Luste
If you use JavaConfig, you must use the 'SpringProcessEngineConfiguration' and 'ProcessEngineFactoryBean' classes (creating its as beans). Here is the example:
@PropertySource({"classpath:jdbc.properties"})
@EnableTransactionManagement
@SpringBootApplication
(
scanBasePackages = {"ru.core",}
)
public class Application {
//other beans
@Bean
SpringProcessEngineConfiguration getProcessEngineConfiguration(@Qualifier("dataSourceForActiviti") DataSource dataSourceForActiviti,
@Qualifier("transactionManagerForActiviti") PlatformTransactionManager transactionManagerForActiviti) {
SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
processEngineConfiguration.setTransactionManager(transactionManagerForActiviti);
processEngineConfiguration
.setDataSource(dataSourceForActiviti)
.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE)
.setAsyncExecutorActivate(true);
processEngineConfiguration.setDeploymentResources(new Resource[]{
new ClassPathResource("bpm/Process1.bpmn20.xml"),
new ClassPathResource("bpm/Process2.bpmn20.xml")
});
return processEngineConfiguration;
}
@Bean
ProcessEngineFactoryBean getProcessEngineFactoryBean(SpringProcessEngineConfiguration processEngineConfiguration) {
ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
processEngineFactoryBean.setProcessEngineConfiguration(processEngineConfiguration);
return processEngineFactoryBean;
}
@Bean
RepositoryService getRepositoryService(ProcessEngineFactoryBean processEngineFactoryBean) throws Exception {
return processEngineFactoryBean.getObject().getRepositoryService();
}
@Bean
RuntimeService getRuntimeService(ProcessEngineFactoryBean processEngineFactoryBean) throws Exception {
return processEngineFactoryBean.getObject().getRuntimeService();
}
@Bean
TaskService getTaskService(ProcessEngineFactoryBean processEngineFactoryBean) throws Exception {
return processEngineFactoryBean.getObject().getTaskService();
}
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.