return descriptions;
}
private Collection<? extends IEObjectDescription> createTriggerSpecificVars(Rule rule) {
List<IEObjectDescription> descriptions = new ArrayList<IEObjectDescription>();
Resource varResource = new XtextResource(URI.createURI("event://specific.vars"));
if(containsCommandTrigger(rule)) {
JvmTypeReference commandTypeRef = typeReferences.getTypeForName(Command.class, rule);
XVariableDeclaration varDecl = XbaseFactory.eINSTANCE.createXVariableDeclaration();
varDecl.setName(RuleContextHelper.VAR_RECEIVED_COMMAND);
varDecl.setType(commandTypeRef);
varDecl.setWriteable(false);
varResource.getContents().add(varDecl);
descriptions.add(new LocalVarDescription(QualifiedName.create(varDecl.getName()), varDecl));
}
if(containsStateChangeTrigger(rule)) {
JvmTypeReference stateTypeRef = typeReferences.getTypeForName(State.class, rule);
XVariableDeclaration varDecl = XbaseFactory.eINSTANCE.createXVariableDeclaration();
varDecl.setName(RuleContextHelper.VAR_PREVIOUS_STATE);
varDecl.setType(stateTypeRef);
varDecl.setWriteable(false);
varResource.getContents().add(varDecl);
descriptions.add(new LocalVarDescription(QualifiedName.create(varDecl.getName()), varDecl));
}
return descriptions;
}