Package org.jbpm.env

Examples of org.jbpm.env.Environment


  public CommentImpl(String message, Execution execution) {
    this.message = message;
    this.execution = (ExecutionImpl) execution;
    this.time = Clock.getCurrentTime();
   
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      this.actorId = environment.getUserId();
    }
  }
View Full Code Here


    if (value==null) {
      log.finest("creating null variable for "+key);
      variable = new NullVariable();
    } else {
   
      Environment environment = Environment.getCurrent();
      if (environment!=null) {
        VariableTypeResolver variableTypeResolver = environment.get(VariableTypeResolver.class);
        if (variableTypeResolver!=null) {
          variable = variableTypeResolver.createVariable(key, value, this);
        }
      }
   
View Full Code Here

  private static final long serialVersionUID = 1L;

  public Object construct(WireContext wireContext) {
    EnvironmentInterceptor environmentInterceptor = new EnvironmentInterceptor();
    Environment environment = wireContext.getEnvironment();
    EnvironmentFactory environmentFactory = environment.getEnvironmentFactory();
    environmentInterceptor.setEnvironmentFactory(environmentFactory);
    return environmentInterceptor;
  }
View Full Code Here

  // close ////////////////////////////////////////////////////////////////////

  public void close() {
    defaultEnvironmentFactory.applicationWireContext.fire(DefaultEnvironment.EVENT_CLOSEENVIRONMENT, this);
   
    Environment popped = pop();
    if (this!=popped) {
      throw new PvmException("environment nesting problem");
    }

    Context context = getBlockContext();
View Full Code Here

  public void testPvmDbSession() {
    EnvironmentFactory environmentFactory = EnvironmentFactory.parseResource(
        "org/jbpm/examples/ch10/jbpm.environment.xml"
    );
   
    Environment environment = environmentFactory.openEnvironment();
    try {
      PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
     
      ProcessDefinition processDefinition = ProcessFactory.build("persited process")
      .done();
     
      pvmDbSession.save(processDefinition);
     
    } finally {
      environment.close();
    }
  }
View Full Code Here

* @author Tom Baeyens
*/
public class AuthorizationInterceptor extends Interceptor {

  public Object execute(Command command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new PvmException("no environment for verifying authorization");
    }
    AuthorizationSession authorizationSession = environment.get(AuthorizationSession.class);
    if (authorizationSession==null) {
      throw new PvmException("no AuthorizationSession in environment for verifying authorization");
    }
    authorizationSession.checkPermission(command, environment);
    // if the authorization check succeeded, proceed
View Full Code Here

  }

  protected ClobStrategy getClobStrategy() {
    ClobStrategy clobStrategy = null;
   
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      clobStrategy = (ClobStrategy) environment.get(CLOB_STRATEGY_ENV_KEY);
    }

    if (clobStrategy==null) {
      clobStrategy = DEFAULT_CLOB_STRATEGY;
    }
View Full Code Here

  }

  protected BlobStrategy getBlobStrategy() {
    BlobStrategy blobStrategy = null;
   
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      blobStrategy = (BlobStrategy) environment.get(BLOB_STRATEGY_ENV_KEY);
    }

    if (blobStrategy==null) {
      blobStrategy = DEFAULT_BLOB_STRATEGY;
    }
View Full Code Here

* @author Tom Baeyens
*/
public class TransactionInterceptor extends Interceptor {

  public Object execute(Command command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new PvmException("no environment for verifying authorization");
    }
    Transaction transaction = environment.getTransaction();
    if (transaction==null) {
      throw new PvmException("no transaction in environment");
    }
    try {
      return next.execute(command);
View Full Code Here

public class EnvironmentInterceptor extends Interceptor {

  protected EnvironmentFactory environmentFactory;

  public Object execute(Command command) {
    Environment environment = environmentFactory.openEnvironment();
    try {
      return next.execute(command);
     
    } finally {
      environment.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.jbpm.env.Environment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.