public void SubmitTestEvent(String text) { FactFactory FFactory = FactFactory.eINSTANCE; ActionFactory AFactory = ActionFactory.eINSTANCE; net.sf.ictalive.runtime.fact.LandmarkFulfilment LandMarkF = FFactory.createLandmarkFulfilment(); MatchmakerQuery MQuery = AFactory.createMatchmakerQuery(); MQuery.setQuery(text); LandMarkF.setDueTo(MQuery); eb.setActor("#:" + text + "MatchMakerQuery", "http://EventInjector.com"); try { eb.publish(LandMarkF); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
private void testEventBusNorms() throws Exception { FactFactory FFactory = FactFactory.eINSTANCE; NormInstancesFactory NIFactory = NormInstancesFactory.eINSTANCE; Serialiser<OperAModel> sOpModel = new Serialiser<OperAModel>(OMPackage.class); OperAModel OpModel = sOpModel.deserialise(new URL("file:" + "./TMT-OperettA2.0.opera")); NormInstance NI = NIFactory.createNormInstance(); PartialStateDescriptionInstance psdInstance = NIFactory.createPartialStateDescriptionInstance(); psdInstance.setName("A robar carteras!!"); Norm dummy = OpModel.getOm().getNs().getNorms().get(0); NI.setNorm(dummy); NI.getPartialStateDescriptionInstance().add(psdInstance); NI.setName("#" + dummy.getNormID()); // Norm Instance Activated Event net.sf.ictalive.runtime.fact.NormInstanceActivated NormIA = FFactory.createNormInstanceActivated(); NormIA.setNormInstance(NI); eb.setActor("Activator", "http://EventInjector.com"); eb.publish(NormIA); // EO Norm Instance Activated Event // Norm Instance Violated Event net.sf.ictalive.runtime.fact.NormInstanceViolated NormIV = FFactory.createNormInstanceViolated(); NormIV.setNormInstance(NI); eb.setActor("Violator", "http://EventInjector.com"); eb.publish(NormIV); // EO Norm Instance Violated Event // Norm Instance Expired Event net.sf.ictalive.runtime.fact.NormInstanceExpired NormIE = FFactory.createNormInstanceExpired(); NormIE.setNormInstance(NI); eb.setActor("#:" + "Expirator", "http://EventInjector.com"); eb.publish(NormIE); // EO Norm Instance Expired Event }