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

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

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

Node.getId介绍

[英]The id of the node. This is unique within its NodeContainer.
[中]节点的id。这在其NodeContainer中是独一无二的。

代码示例

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

  1. @Override
  2. public long getId() {
  3. return node.getId();
  4. }

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

  1. public NodeAndType(Node node, String type) {
  2. if (node == null || type == null) {
  3. throw new IllegalArgumentException(
  4. "Node or type may not be null!");
  5. }
  6. this.nodeId = node.getId();
  7. this.node = node;
  8. this.type = type;
  9. }

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

  1. protected void validateRemoveNode(Node node) {
  2. if (node == null) {
  3. throw new IllegalArgumentException("Node is null");
  4. }
  5. if (this.nodes.get(node.getId()) == null) {
  6. throw new IllegalArgumentException("Unknown node: " + node);
  7. }
  8. }

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

  1. public void addNode(final Node node) {
  2. validateAddNode(node);
  3. if (!this.nodes.containsValue(node)) {
  4. this.nodes.put(new Long(node.getId()), node);
  5. }
  6. }

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

  1. @Override
  2. public int compare(NodeInstance o1, NodeInstance o2) {
  3. if (o1.getNodeId() == lookFor.getId()) {
  4. return 1;
  5. } else if (o2.getNodeId() == lookFor.getId()) {
  6. return -1;
  7. }
  8. return 0;
  9. }
  10. });

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

  1. public void removeNode(final Node node) {
  2. validateRemoveNode(node);
  3. this.nodes.remove(new Long(node.getId()));
  4. }

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

  1. private void decreaseAllTriggers() {
  2. // decrease trigger count for all incoming connections
  3. for (final Connection connection: getJoin().getDefaultIncomingConnections()) {
  4. final Integer count = (Integer) this.triggers.get( connection.getFrom().getId() );
  5. if ( count.intValue() == 1 ) {
  6. this.triggers.remove( connection.getFrom().getId() );
  7. } else {
  8. this.triggers.put( connection.getFrom().getId(),
  9. count.intValue() - 1 );
  10. }
  11. }
  12. }

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

  1. protected void addErrorMessage(RuleFlowProcess process,
  2. Node node,
  3. List<ProcessValidationError> errors,
  4. String message) {
  5. String error = String.format("Node '%s' [%d] " + message,
  6. node.getName(),
  7. node.getId());
  8. errors.add(new ProcessValidationErrorImpl(process,
  9. error));
  10. }
  11. }

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

  1. public CompositeNodeEnd(CompositeNode parentNode, Node outNode, String outType) {
  2. setName("Composite node end");
  3. this.outNodeId = outNode.getId();
  4. this.outNode = outNode;
  5. this.outType = outType;
  6. this.parentNode = parentNode;
  7. setMetaData("hidden", true);
  8. }

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

  1. public CompositeNodeStart(CompositeNode parentNode, Node outNode, String outType) {
  2. setName("Composite node start");
  3. this.inNodeId = outNode.getId();
  4. this.inNode = outNode;
  5. this.inType = outType;
  6. this.parentNode = parentNode;
  7. setMetaData("hidden", true);
  8. }

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

  1. public Constraint getConstraint(final Connection connection) {
  2. if (connection == null) {
  3. throw new IllegalArgumentException("connection is null");
  4. }
  5. ConnectionRef ref = new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType());
  6. return this.constraints.get(ref);
  7. }

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

  1. public Constraint getConstraint(final Connection connection) {
  2. if ( connection == null ) {
  3. throw new IllegalArgumentException( "connection is null" );
  4. }
  5. ConnectionRef ref = new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType());
  6. return this.constraints.get(ref);
  7. }

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

  1. public Constraint getConstraint(final Connection connection) {
  2. if ( connection == null ) {
  3. throw new IllegalArgumentException( "connection is null" );
  4. }
  5. if ( this.type == TYPE_OR || this.type == TYPE_XOR ) {
  6. ConnectionRef ref = new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType());
  7. return this.constraints.get(ref);
  8. }
  9. throw new UnsupportedOperationException( "Constraints are " +
  10. "only supported with XOR or OR split types, not with: " + getType() );
  11. }

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

  1. private boolean checkAllActivated() {
  2. // check whether all parent nodes have been triggered
  3. for (final Connection connection: getJoin().getDefaultIncomingConnections()) {
  4. if ( this.triggers.get( connection.getFrom().getId() ) == null ) {
  5. return false;
  6. }
  7. }
  8. return true;
  9. }

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

  1. public void setConstraint(final Connection connection, final Constraint constraint) {
  2. if (connection == null) {
  3. throw new IllegalArgumentException("connection is null");
  4. }
  5. if (!getDefaultOutgoingConnections().contains(connection)) {
  6. throw new IllegalArgumentException("connection is unknown:" + connection);
  7. }
  8. addConstraint(new ConnectionRef((String)connection.getMetaData().get("UniqueId"),
  9. connection.getTo().getId(), connection.getToType()), constraint);
  10. }

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

  1. public void setConstraint(final Connection connection,
  2. final Constraint constraint) {
  3. if ( connection == null ) {
  4. throw new IllegalArgumentException( "connection is null" );
  5. }
  6. if (!getDefaultOutgoingConnections().contains(connection)) {
  7. throw new IllegalArgumentException("connection is unknown:" + connection);
  8. }
  9. addConstraint(
  10. new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType()),
  11. constraint);
  12. }

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

  1. public static String getUniqueNodeId(Node node) {
  2. String result = (String) node.getMetaData().get("UniqueId");
  3. if (result != null) {
  4. return result;
  5. }
  6. result = node.getId() + "";
  7. NodeContainer nodeContainer = node.getNodeContainer();
  8. while (nodeContainer instanceof CompositeNode) {
  9. CompositeNode composite = (CompositeNode) nodeContainer;
  10. result = composite.getId() + "-" + result;
  11. nodeContainer = composite.getNodeContainer();
  12. }
  13. return "_" + result;
  14. }

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

  1. public void removeConstraint(Connection connection) {
  2. ConnectionRef ref = new ConnectionRef((String)connection.getMetaData().get("UniqueId"), connection.getTo().getId(), connection.getToType());
  3. internalRemoveConstraint(ref);
  4. }

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

  1. public void validateRemoveIncomingConnection(final String type, final Connection connection) {
  2. CompositeNode.NodeAndType nodeAndType = internalGetLinkedIncomingNode(type);
  3. if (nodeAndType != null) {
  4. for (Connection inConnection: nodeAndType.getNode().getIncomingConnections(nodeAndType.getType())) {
  5. if (((CompositeNodeStart) inConnection.getFrom()).getInNodeId() == connection.getFrom().getId()) {
  6. ((NodeImpl) nodeAndType.getNode()).validateRemoveIncomingConnection(nodeAndType.getType(), inConnection);
  7. return;
  8. }
  9. }
  10. throw new IllegalArgumentException(
  11. "Could not find internal incoming connection for node");
  12. }
  13. }

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

  1. public void validateRemoveOutgoingConnection(final String type, final Connection connection) {
  2. CompositeNode.NodeAndType nodeAndType = internalGetLinkedOutgoingNode(type);
  3. if (nodeAndType != null) {
  4. for (Connection outConnection: nodeAndType.getNode().getOutgoingConnections(nodeAndType.getType())) {
  5. if (((CompositeNodeEnd) outConnection.getTo()).getOutNodeId() == connection.getTo().getId()) {
  6. ((NodeImpl) nodeAndType.getNode()).validateRemoveOutgoingConnection(nodeAndType.getType(), outConnection);
  7. return;
  8. }
  9. }
  10. throw new IllegalArgumentException(
  11. "Could not find internal outgoing connection for node");
  12. }
  13. }

相关文章