⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forkimpl.java

📁 一个java工作流引擎
💻 JAVA
字号:
package org.jbpm.model.definition.impl;

import org.jbpm.*;
import org.jbpm.delegation.*;
import org.jbpm.model.definition.*;
import org.jbpm.model.execution.impl.*;

public class ForkImpl extends NodeImpl implements Fork {

  private JoinImpl correspondingJoin = null;
  private transient DelegationImpl forkDelegation = null;
  
	public ForkImpl() {
	}

  public ForkImpl( String name ) {
    super( name );
  }

  public Join getCorrespondingJoin() { return this.correspondingJoin; }
  public void setCorrespondingJoin(JoinImpl correspondingJoin) { this.correspondingJoin = correspondingJoin; }
  
  public DelegationImpl getForkDelegation() { return forkDelegation; }
  public void setForkDelegation ( DelegationImpl forkDelegation ) { this.forkDelegation = forkDelegation;  }

  public void acceptToken(ExecutionContextImpl executionContext) throws ExecutionException {

    // execute the actions on node entrance
    executeActions( EventType.FORK_ENTER, executionContext );

    TokenImpl token = (TokenImpl) executionContext.getToken();
    token.setState( null );
    token.setActorId( null );
    
    // if this fork has a custom forkhandler specified
    if ( forkDelegation != null ) {
      // instantiate it
      ForkHandler forkHandler = (ForkHandler) forkDelegation.instantiate();
      try {
        // and use it
        forkHandler.fork( executionContext );
      } catch (RuntimeException e) {
        forkDelegation.handleException(e);
      }

    } else { // this fork does not have a fork handler specified
      ForkHandler forkHandler = (ForkHandler) new DelegationImpl( definition, "org.jbpm.delegation.fork.DefaultForkHandler" ).instantiate();
      forkHandler.fork( executionContext );
    }

  }
  
  public String toString() {
    return "fork["+name+"]"; 
  }

  public void toXml(org.dom4j.Element element) {
    toXmlNameAndDescription(element);
    if ( forkDelegation != null ) {
      forkDelegation.toXml( element.addElement("delegation"));
    }
    toXmlActions(element);
    toXmlTransitions(element);
  }

  public String getTagName() {
    return "fork";
  }

	public EventType getDefaultEventType() {
		return EventType.FORK_ENTER;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -