ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.vci.server.workflow.server;
 
import org.hibernate.SessionFactory;
import org.jbpm.api.ProcessEngine;
 
import com.vci.server.base.persistence.dao.HibernateSessionFactory;
 
public class JbpmEngine {
    private static ProcessEngine singleton;
 
    public static ProcessEngine getProcessEngine() {
        if (singleton == null) {
            synchronized (JbpmEngine.class) {
                if (singleton == null) {
                    SessionFactory sessionFactory =  HibernateSessionFactory.getSessionFactory();
                    sessionFactory.openSession();
                    singleton = new org.jbpm.api.Configuration()
                            .setHibernateSessionFactory(sessionFactory)
                            .buildProcessEngine();
                }
            }
        }
        return JbpmEngine.singleton;
    }
 
}