gpt4 book ai didi

org.kie.api.definition.process.WorkflowProcess.getMetaData()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 16:23:05 25 4
gpt4 key购买 nike

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

WorkflowProcess.getMetaData介绍

暂无

代码示例

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

protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) {
  Map<String, Object> metaData = getMetaData(process.getMetaData());
  Set<String> imports = ((org.jbpm.process.core.Process) process).getImports();
  Map<String, String> globals = ((org.jbpm.process.core.Process) process).getGlobals();
  if ((imports != null && !imports.isEmpty()) || (globals != null && globals.size() > 0) || !metaData.isEmpty()) {
    xmlDump.append("    <extensionElements>" + EOL);
    if (imports != null) {
      for (String s: imports) {
        xmlDump.append("     <tns:import name=\"" + s + "\" />" + EOL);
      }
    }
    if (globals != null) {
      for (Map.Entry<String, String> global: globals.entrySet()) {
        xmlDump.append("     <tns:global identifier=\"" + global.getKey() + "\" type=\"" + global.getValue() + "\" />" + EOL);
      }
    }
    writeMetaData(getMetaData(process.getMetaData()), xmlDump);
    xmlDump.append("    </extensionElements>" + EOL);
  }
  // TODO: function imports
  // TODO: exception handlers
  VariableScope variableScope = (VariableScope)
    ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
  if (variableScope != null) {
    visitVariables(variableScope.getVariables(), xmlDump);
  }
  visitLanes(process, xmlDump);
}

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

Integer routerLayout = (Integer) process.getMetaData().get("routerLayout");
if (routerLayout != null && routerLayout != 0) {
  xmlDump.append("routerLayout=\"" + routerLayout + "\" ");

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

protected void visitProcess(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) {
  String targetNamespace = (String) process.getMetaData().get("TargetNamespace");
  if (targetNamespace == null) {
    targetNamespace = "http://www.jboss.org/drools";
    ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
  Set<String> dumpedItemDefs = new HashSet<String>();
  Map<String, ItemDefinition> itemDefs = (Map<String, ItemDefinition>) process.getMetaData().get("ItemDefinitions");
  Definitions def = (Definitions) process.getMetaData().get("Definitions");
  visitErrors(def, xmlDump);
  visitConnections(process.getNodes(), xmlDump, metaDataType);
  List<Association> associations = (List<Association>) process.getMetaData().get(ProcessHandler.ASSOCIATIONS);
  if( associations != null ) {
    for (Association association : associations ) {

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

private void registerExternalEventNodeListeners() {
  for (Node node : getWorkflowProcess().getNodes()) {
    if (node instanceof EventNode) {
      if ("external".equals(((EventNode) node).getScope())) {
        addEventListener(((EventNode) node).getType(), EMPTY_EVENT_LISTENER, true);
      }
    } else if (node instanceof EventSubProcessNode) {
      List<String> events = ((EventSubProcessNode) node).getEvents();
      for (String type : events) {
        addEventListener(type, EMPTY_EVENT_LISTENER, true);
        if (isVariableExpression(type)) {
          addEventListener(resolveVariable(type), EMPTY_EVENT_LISTENER, true);
        }
      }
    }  else if (node instanceof DynamicNode) {
      if (((DynamicNode) node).getActivationEventName() != null) {
      
        addEventListener(((DynamicNode) node).getActivationEventName(), EMPTY_EVENT_LISTENER, true);
      }
    }
  }
  if( getWorkflowProcess().getMetaData().containsKey("Compensation") ) {
    addEventListener("Compensation", new CompensationEventListener(this), true);
  }
}

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

protected void visitHeader(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) {
  Map<String, Object> metaData = getMetaData(process.getMetaData());
  Set<String> imports = ((org.jbpm.process.core.Process) process).getImports();
  Map<String, String> globals = ((org.jbpm.process.core.Process) process).getGlobals();
  if ((imports != null && !imports.isEmpty()) || (globals != null && globals.size() > 0) || !metaData.isEmpty()) {
    xmlDump.append("    <extensionElements>" + EOL);
    if (imports != null) {
      for (String s: imports) {
        xmlDump.append("     <tns:import name=\"" + s + "\" />" + EOL);
      }
    }
    if (globals != null) {
      for (Map.Entry<String, String> global: globals.entrySet()) {
        xmlDump.append("     <tns:global identifier=\"" + global.getKey() + "\" type=\"" + global.getValue() + "\" />" + EOL);
      }
    }
    writeMetaData(getMetaData(process.getMetaData()), xmlDump);
    xmlDump.append("    </extensionElements>" + EOL);
  }
  // TODO: function imports
  // TODO: exception handlers
  VariableScope variableScope = (VariableScope)
    ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
  if (variableScope != null) {
    visitVariables(variableScope.getVariables(), xmlDump);
  }
  visitLanes(process, xmlDump);
}

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

Integer routerLayout = (Integer) process.getMetaData().get("routerLayout");
if (routerLayout != null && routerLayout != 0) {
  xmlDump.append("routerLayout=\"" + routerLayout + "\" ");

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

protected void visitProcess(WorkflowProcess process, StringBuilder xmlDump, int metaDataType) {
  String targetNamespace = (String) process.getMetaData().get("TargetNamespace");
  if (targetNamespace == null) {
    targetNamespace = "http://www.jboss.org/drools";
    ((org.jbpm.process.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
  Set<String> dumpedItemDefs = new HashSet<String>();
  Map<String, ItemDefinition> itemDefs = (Map<String, ItemDefinition>) process.getMetaData().get("ItemDefinitions");
  Definitions def = (Definitions) process.getMetaData().get("Definitions");
  visitErrors(def, xmlDump);
  visitConnections(process.getNodes(), xmlDump, metaDataType);
  List<Association> associations = (List<Association>) process.getMetaData().get(ProcessHandler.ASSOCIATIONS);
  if( associations != null ) {
    for (Association association : associations ) {

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

private void registerExternalEventNodeListeners() {
  for (Node node : getWorkflowProcess().getNodes()) {
    if (node instanceof EventNode) {
      if ("external".equals(((EventNode) node).getScope())) {
        addEventListener(((EventNode) node).getType(), EMPTY_EVENT_LISTENER, true);
      }
    } else if (node instanceof EventSubProcessNode) {
      List<String> events = ((EventSubProcessNode) node).getEvents();
      for (String type : events) {
        addEventListener(type, EMPTY_EVENT_LISTENER, true);
        if (isVariableExpression(type)) {
          addEventListener(resolveVariable(type), EMPTY_EVENT_LISTENER, true);
        }
      }
    }  else if (node instanceof DynamicNode) {
      if (((DynamicNode) node).getActivationEventName() != null) {
      
        addEventListener(((DynamicNode) node).getActivationEventName(), EMPTY_EVENT_LISTENER, true);
      }
    }
  }
  if( getWorkflowProcess().getMetaData().containsKey("Compensation") ) {
    addEventListener("Compensation", new CompensationEventListener(this), true);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com