org.kie.api.runtime.rule.Match.getDeclarationIds()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.kie.api.runtime.rule.Match.getDeclarationIds()方法的一些代码示例,展示了Match.getDeclarationIds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Match.getDeclarationIds()方法的具体详情如下:
包路径:org.kie.api.runtime.rule.Match
类名称:Match
方法名:getDeclarationIds

Match.getDeclarationIds介绍

暂无

代码示例

代码示例来源:origin: kiegroup/jbpm

protected boolean checkDeclarationMatch(Match match, String matchVariable) {   
  if (matchVariable == null) {
    // no extra check is needed
    return true;
  }
  
  Object dec = match.getDeclarationIds().contains("$" + matchVariable) ? match.getDeclarationValue("$" + matchVariable) : match.getDeclarationValue(matchVariable);      
  Object var = getVariable(matchVariable);
  
  boolean check = var.equals(dec);
  
  return check;
}

代码示例来源:origin: kiegroup/jbpm

@Override
public void signalEvent(String type, Object event) {
  if (type.startsWith("RuleFlow-AdHocActivate")) {
    if (event instanceof MatchCreatedEvent) {
      Match match = ((MatchCreatedEvent) event).getMatch();                
      match.getDeclarationIds().forEach(s -> this.setVariable(s.replaceFirst("\\$", ""), match.getDeclarationValue(s)));                
    }            
    trigger(null, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
  } else if (getActivationEventType().equals(type)) {
    if (event instanceof MatchCreatedEvent) {
      matchCreated((MatchCreatedEvent) event);
    }
  } else {
    super.signalEvent(type, event);
    for (Node node: getCompositeNode().getNodes()) {
      
      if (type.equals(resolveVariable(node.getName())) && node.getIncomingConnections().isEmpty()) {
        triggerSelectedNode(node, event);
      }
    }
  }
}

代码示例来源:origin: org.drools/knowledge-api

public List<String> getDeclarationIDs() {
  return delegate.getDeclarationIds();
}

代码示例来源:origin: org.jbpm/jbpm-flow

protected boolean checkDeclarationMatch(Match match, String matchVariable) {   
  if (matchVariable == null) {
    // no extra check is needed
    return true;
  }
  
  Object dec = match.getDeclarationIds().contains("$" + matchVariable) ? match.getDeclarationValue("$" + matchVariable) : match.getDeclarationValue(matchVariable);      
  Object var = getVariable(matchVariable);
  
  boolean check = var.equals(dec);
  
  return check;
}

代码示例来源:origin: org.jbpm/jbpm-flow

@Override
public void signalEvent(String type, Object event) {
  if (type.startsWith("RuleFlow-AdHocActivate")) {
    if (event instanceof MatchCreatedEvent) {
      Match match = ((MatchCreatedEvent) event).getMatch();                
      match.getDeclarationIds().forEach(s -> this.setVariable(s.replaceFirst("\\$", ""), match.getDeclarationValue(s)));                
    }            
    trigger(null, org.jbpm.workflow.core.Node.CONNECTION_DEFAULT_TYPE);
  } else if (getActivationEventType().equals(type)) {
    if (event instanceof MatchCreatedEvent) {
      matchCreated((MatchCreatedEvent) event);
    }
  } else {
    super.signalEvent(type, event);
    for (Node node: getCompositeNode().getNodes()) {
      
      if (type.equals(resolveVariable(node.getName())) && node.getIncomingConnections().isEmpty()) {
        triggerSelectedNode(node, event);
      }
    }
  }
}

相关文章