Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BZ-1084686 - separation between process/task engine and audit trail p…
…ersistence
- Loading branch information
1 parent
55d2239
commit 999c5c6
Showing
36 changed files
with
914 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
732 changes: 404 additions & 328 deletions
732
...-task-audit/src/main/java/org/jbpm/services/task/audit/JPATaskLifeCycleEventListener.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...n-task-jpa/src/main/java/org/jbpm/services/task/persistence/PersistableEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.jbpm.services.task.persistence; | ||
|
||
import javax.persistence.EntityManagerFactory; | ||
|
||
import org.kie.api.task.TaskLifeCycleEventListener; | ||
import org.kie.internal.task.api.TaskPersistenceContext; | ||
|
||
public abstract class PersistableEventListener implements TaskLifeCycleEventListener { | ||
|
||
private EntityManagerFactory emf; | ||
|
||
public PersistableEventListener(EntityManagerFactory emf) { | ||
this.emf = emf; | ||
} | ||
|
||
protected TaskPersistenceContext getPersistenceContext(TaskPersistenceContext persistenceContext) { | ||
if (emf != null) { | ||
return new JPATaskPersistenceContext(emf.createEntityManager()) { | ||
|
||
@Override | ||
public void close() { | ||
em.flush(); | ||
super.close(); | ||
} | ||
|
||
}; | ||
} | ||
|
||
return persistenceContext; | ||
} | ||
|
||
protected void cleanup(TaskPersistenceContext persistenceContext) { | ||
if (emf != null) { | ||
persistenceContext.close(); | ||
} | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.