ksession = restoreSession(ksession, true);
ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());
receiveTaskHandler.setKnowledgeRuntime(ksession);
ksession.getWorkItemManager().registerWorkItemHandler("Receive Task", receiveTaskHandler);
receiveTaskHandler.messageReceived("YesMessage", "YesValue");
assertProcessInstanceCompleted(processInstance.getId(), ksession);
receiveTaskHandler.messageReceived("NoMessage", "NoValue");
ksession = restoreSession(ksession, true);
ksession.getWorkItemManager().registerWorkItemHandler("Email1", new SystemOutWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("Email2", new SystemOutWorkItemHandler());