01-10-2011 10:53 AM
01-11-2011 06:40 AM
02-05-2011 06:50 AM
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="processHelperBean" class="de.mycompany.beans.ProcessHelperBean"/>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="transactionDataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<property name="targetDataSource" ref="dataSource"/>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="transactionDataSource" />
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="databaseType" value="mysql" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="deploymentResources" value="classpath*:/process/*.bpmn20.xml" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
<bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
<bean id="workflowManager" class="de.mycompany.service.WorkflowManager">
<property name="repositoryService" ref="repositoryService" />
<property name="runtimeService" ref="runtimeService" />
<property name="taskService" ref="taskService" />
<property name="historyService" ref="historyService" />
<property name="managementService" ref="managementService" />
<property name="identityService" ref="identityService" />
<property name="formService" ref="formService" />
<property name="persistenceManager" ref="persistenceManager" />
</bean>
</beans>
<serviceTask id="DEACTIVATED" activiti:expression="${processHelperBean.setStatus('DEACTIVATED')}" />
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'processHelperBean'
02-07-2011 03:49 AM
06-06-2011 10:29 AM
<process id="MyProcess" name="myProcess">
<documentation>Place documentation for the 'myProcess' process here.</documentation>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<serviceTask id="servicetask1" name="Create JPA object" activiti:expression="loanRequestBean.newLoanRequest()" activiti:resultVariableName="loanRequest"></serviceTask>
<userTask id="usertask1" name="object property is ${loanRequest.customerName}" activiti:assignee="spec"></userTask>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="servicetask1" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow3" name="" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
</process>
public class LoanRequestBean {
@PersistenceContext
private EntityManager entityManager;
@Transactional
public LoanRequest newLoanRequest() {
LoanRequest lr = new LoanRequest();
lr.setCustomerName("simple name");
entityManager.persist(lr);
return lr;
}
public LoanRequest getLoanRequest(Long id) {
return entityManager.find(LoanRequest.class, id);
}
}
@Entity(name = "SPRING_TEST_ORDER")
public class LoanRequest {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID_")
private Long id;
@Column(name = "CUSTOMER_NAME_")
private String customerName;
@Column(name = "AMOUNT_")
private Long amount;
@Column(name = "APPROVED_")
private boolean approved;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
…
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:component-scan base-package="com.mycompany.beans"/>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="org.h2.Driver" />
<property name="url" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
<property name="username" value="sa" />
<property name="password" value="" />
<property name="defaultAutoCommit" value="false" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="false"/>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="persistenceXmlLocation">
<value>classpath:/com/mycompany/beans/persistence.xml</value>
</property>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
<property name="databasePlatform" value="org.apache.openjpa.jdbc.sql.H2Dictionary" />
</bean>
</property>
</bean>
<bean id="loanRequestBean" class="com.mycompany.beans.LoanRequestBean">
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jpaEntityManagerFactory" ref="entityManagerFactory" />
<property name="jpaHandleTransaction" value="false" />
<property name="jpaCloseEntityManager" value="false" />
<property name="jobExecutorActivate" value="false" />
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
</beans>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0"
>
<persistence-unit name="activiti-jpa-pu">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>com.mycompany.beans.LoanRequest</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
<property name="openjpa.LockTimeout " value="30000"/>
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents')"/>
</properties>
</persistence-unit>
</persistence>
06-06-2011 11:14 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.