Hi all,
activiti works fine if return type is void, if method returns "JPA Entity" 'LoanRequest'
is throws Cannot flush EntityManager, an active transaction is require.
@Transactional()
//public void createLoanRequest() { working fine
\\ below method throws "Cannot flush EntityManager, an active transaction is require" error
public LoanRequest createLoanRequest() {
System.out.println("Calling JPA Entity");
LoanRequest loanRequest = new LoanRequest();
loanRequest.setId(3424L);
loanRequest.setValue("kiran");
entityManager.persist(loanRequest);
return loanRequest;
}
xml looks like:
<serviceTask id="loanDeptReq" name="loanDeptReq"
activiti:expression="${loanService.createLoanRequest()}"
activiti:resultVariable="loanRequest"/>
pls let me know if some missing in config or code.
Regards
Kiran.