Package org.jbpm.env

Examples of org.jbpm.env.Environment


public class AsyncCommandService implements CommandService {
 
  boolean propagateUserId = true;

  public Object execute(Command command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new PvmException("no environment for verifying authorization");
    }
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new PvmException("no message session for executing command asynchronously");
    }
    String userId = (propagateUserId ? environment.getUserId() : null);
    messageSession.send(new AsyncCommandMessage(command, userId));
    return null;
  }
View Full Code Here


public class StandardCommandService implements CommandService {

  private static final Logger log = Logger.getLogger(StandardCommandService.class.getName());

  public Object execute(Command command) {
    Environment environment = Environment.getCurrent();
    try {
      return command.execute(environment);
    } catch (RuntimeException e) {
      log.log(Level.SEVERE, "exception while executing command "+command, e);
      throw e;
View Full Code Here

    }

    // identify the wireContext
    WireContext wireContext = null;
    if (contextName!=null) {
      Environment environment = targetWireContext.getEnvironment();
      if (environment!=null) {
        try {
          wireContext = (WireContext) environment.getContext(contextName);
          if (wireContext==null) {
            throw new WireException("couldn't subscribe because context "+contextName+" doesn't exist");
          }
        } catch (ClassCastException e) {
          throw new WireException("couldn't subscribe because context "+contextName+" is not a WireContext", e);
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.