Examples of IncomingCallEvent


Examples of org.plugtree.training.event.IncomingCallEvent

        MeetingStartEvent meetingEvent = new MeetingStartEvent(meeting);
        meetingsEP.insert(meetingEvent);

        //30 minutes later, a call to Paul arrives.
        clock.advanceTime(30, TimeUnit.MINUTES);
        IncomingCallEvent callEvent = new IncomingCallEvent(paul);
        incomingCallsEP.insert(callEvent);
        assertEquals(IncomingCallEvent.CallStatus.PENDING, callEvent.getStatus());

        ksession.fireAllRules();

        //because Paul is in a meeting the call is redirected to an answering machine
        assertEquals(IncomingCallEvent.CallStatus.REDIRECTED, callEvent.getStatus());


        //at the same time, an incoming call to Michael arrives
        callEvent = new IncomingCallEvent(michael);
        incomingCallsEP.insert(callEvent);
       
        assertEquals(IncomingCallEvent.CallStatus.PENDING, callEvent.getStatus());
        clock.advanceTime(1, TimeUnit.MINUTES);
       
        System.out.println("FIRE FIRE");
        ksession.fireAllRules();

        //because Michael is not in a meeting the call is dispatched
        assertEquals(IncomingCallEvent.CallStatus.DISPATCHED, callEvent.getStatus());

        ksession.dispose();
    }
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.