Viatra检查文本是否与regexp-won匹配';不能使用参数

Viatra检查文本是否与regexp-won匹配';不能使用参数,regex,validation,parameter-passing,eclipse-emf,Regex,Validation,Parameter Passing,Eclipse Emf,我有一个Q&a模型来管理问题和答案,我将用它来生成降价文件。但在生成之前,我想验证实例模型。我正在使用Eclipse建模框架 我的问题是以下查询: @Constraint( key = {qa, id}, severity = "error", message = "Question/Answer $qa.text$ has a reference to a link but link with id $id$ does not exist.

我有一个Q&a模型来管理问题和答案,我将用它来生成降价文件。但在生成之前,我想验证实例模型。我正在使用Eclipse建模框架

我的问题是以下查询:

@Constraint(
    key = {qa, id},
    severity = "error",
    message = "Question/Answer $qa.text$ has a reference to a link but link with id $id$ does not exist.",
    targetEditorId = "qao.presentation.QaoEditorID"
)
pattern unconsistentTextLinkReferences(qa: QuestionAnswer, id: java Integer) {
    QuestionAnswer.text(qa, text);
    check (text.matches(".*([[]url#" + id + "@\\S*[]]).*"));
    neg find qaTextLink(qa, id);
}

private pattern qaTextLink(
    qa: QuestionAnswer, id: java Integer
) = {
    QuestionAnswer.textlink(qa, text);
    TextLink.id(text, id);
}
正如你们所看到的,我有一个公式,我可以在文本中搜索,我想用标记语法中的引用替换它们。我真正想用上面的模式检查的是TextLink对象是否存在,该对象具有一个特定的id,该id在hashmark后面的公式中找到。目标是在实例模型中不存在此类id时获取错误消息

匹配字符串的示例: [url]#3@somealt text](“[”和“]”括号也是正则表达式的一部分)

不要担心整个过程中真正的url部分,它是实例模型的一部分。我只对本节中url的id感兴趣

但问题来了。我在Eclipse中得到了这个错误消息,我根本无法理解它

Multiple markers at this line
- Parameter 'id' has no enumerable reference in body '#1'.
- The pattern body contains constraints which are only loosely
   connected. This may negatively impact performance. The weakly
   dependent partitions are: [id][qa, text]
我的模式有什么问题