Package org.drools.runtime

Examples of org.drools.runtime.StatefulKnowledgeSession.wait()


    @Override
    public void waitForFlowToFinishIndefinitely(long id) throws InterruptedException, WorkflowException {
        StatefulKnowledgeSession session = getSessionForCurrentContext();
        synchronized (session) {
            while (session.getProcessInstance(id) != null) {
                session.wait();
            }
        }
    }

    @Override
View Full Code Here


    public boolean waitForFlowToFinish(long id, long timeout) throws InterruptedException, WorkflowException {
        StatefulKnowledgeSession session = getSessionForCurrentContext();
        long endTime = System.currentTimeMillis() + timeout;
        synchronized (session) {
            while (session.getProcessInstance(id) != null && timeout > 0) {
                session.wait(timeout);
                timeout = endTime - System.currentTimeMillis();
            }
        }
        return !getRunningFlows().contains(id);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.