Examples of TokenContext


Examples of org.openbp.server.context.TokenContext

   */
  public boolean hasProcessVariableValue(final String variableName)
  {
    if (hasParamValue(CoreConstants.PROCESS_VARIABLE_INDICATOR + variableName))
      return true;
    TokenContext parentContext = getParentContext();
    if (parentContext != null)
      return parentContext.hasProcessVariableValue(variableName);
    return false;
  }
View Full Code Here

Examples of org.openbp.server.context.TokenContext

  @Test
  public void testStandardRollbackProcessor()
    throws Exception
  {
    // Create the process context and start the process
    TokenContext token = createToken();
    token.registerObserver(this, new String[] { EngineExceptionHandlerEvent.HANDLE_EXCEPTION });

    getProcessFacade().startToken(token, "/TestCase/RollbackLocalErrorHandlerTest.Start", null);

    Engine engine = this.getProcessServer().getEngine();
    engine.executeContext(token);
View Full Code Here

Examples of org.openbp.server.context.TokenContext

    throws Exception
  {
    scheduler = (QuartzProcessScheduler) getProcessServer().getProcessScheduler();

    getProcessServer().getProcessFacade().begin();
    TokenContext tc = createToken();
    getProcessServer().getProcessFacade().prepareTokenForScheduler(tc);
    getProcessServer().getProcessFacade().commit();

    ProcessJobDescriptor job1 = new ProcessJobDescriptor();
    job1.setJobName("job1");
View Full Code Here

Examples of org.openbp.server.context.TokenContext

   */
  @Transactional(propagation = Propagation.REQUIRED)
  public Object startProcess(VacationData data)
  {
    // Create the process context and start the process
    TokenContext token = getProcessFacade().createToken();
    // We need to retrieve the process' output parameters, so do not delete the process after it has completed.
    token.setDeleteAfterCompletion(false);
    token.setDebuggerId("Deb1");

    // Start the process
    Map<String, Object> inputParam = new HashMap<String, Object>();
    inputParam.put("Data", data);
    getProcessFacade().startToken(token, "/VacationRequest/HandleVacationRequest.Start", inputParam);

    // Note: We do not have asynchronous processing in the workflow, so we use blocking execution
    // (i. e. execute the process right here in this thread).
    // Otherweise, the execution would have to be done by some worker thread (blocking execution).
    getProcessFacade().executePendingContextsInThisThread();

    return token.getId();
  }
View Full Code Here

Examples of org.openbp.server.context.TokenContext

   * @param ee Engine executor that called this method
   * @throws OpenBPException On error
   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    PlaceholderNode node = (PlaceholderNode) entrySocket.getNode();

    NodeSocket nextSocket = node.getDefaultExitSocket();
    if (nextSocket == null)
    {
      String msg = LogUtil.error(getClass(), "No default exit socket present for placeholder node $0. [{1}]", node.getQualifier(), context);
      throw new EngineException("NoDefaultExitSocket", msg);
    }
    context.setCurrentSocket(nextSocket);
  }
View Full Code Here

Examples of org.openbp.server.context.TokenContext

    if (hasActiveObservers(eventType))
    {
      // Note that this block is synchronized, so only one event may be processed by a client at a time
      synchronized(this)
      {
        TokenContext context = ((EngineEvent) event).getContext();
        TokenContextUtil.checkTerminationRequest(context);

        super.fireEvent(event);

        TokenContextUtil.checkTerminationRequest(context);
View Full Code Here

Examples of org.openbp.server.context.TokenContext

   * @param ee Engine executor that called this method
   * @throws OpenBPException On error
   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();

    WorkflowTask workflowTask = createWorkflowTask(entrySocket, context);

    // Continue with the 'TaskPublished' socket
    NodeSocket nextSocket = getEngine().resolveSocketRef(CoreConstants.SOCKET_TASK_PUBLISHED, entrySocket, context, false);

    if (nextSocket != null)
    {
      Param workflowTaskParam = nextSocket.getParamByName(CoreConstants.WORKFLOWTASK_PARAM_NAME);
      if (workflowTaskParam != null)
      {
        // If the exit socket contains a 'WorkflowTask' parameter, set it
        TokenContextUtil.setParamValue(context, workflowTaskParam, workflowTask);
      }
      context.setCurrentSocket(nextSocket);
    }
    else
    {
      // No 'TaskPublished' socket -> Stop here
      context.setLifecycleRequest(LifecycleRequest.SUSPEND_IMMEDIATE);
    }
  }
View Full Code Here

Examples of org.openbp.server.context.TokenContext

   * @param ee Engine executor that called this method
   * @throws OpenBPException On error
   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    VisualNode node = (VisualNode) entrySocket.getNode();

    // A visual node might be a persisting node, so make the engine persist the process state.
    if (node.isWaitStateNode())
    {
      context.setLifecycleRequest(LifecycleRequest.SUSPEND_IMMEDIATE);
    }

    // We do not alter the current node - this needs to be done by the visual implementation
  }
View Full Code Here

Examples of org.openbp.server.context.TokenContext

   * @param ee Engine executor that called this method
   * @throws OpenBPException On error
   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    WaitStateNode node = (WaitStateNode) entrySocket.getNode();

    // A wait state node usually is always persistent, so make the engine persist the process state.
    context.setLifecycleRequest(LifecycleRequest.SUSPEND_IMMEDIATE);

    // Execution will continue at the default exit socket when triggered by the application program.
    NodeSocket nextSocket = node.getDefaultExitSocket();
    if (nextSocket == null)
    {
      String msg = LogUtil.error(getClass(), "No default exit socket present for wait state node $0. [{1}]", node.getQualifier(), context);
      throw new EngineException("NoDefaultExitSocket", msg);
    }
    context.setCurrentSocket(nextSocket);
  }
View Full Code Here

Examples of org.openbp.server.context.TokenContext

   * @param ee Engine executor that called this method
   * @throws OpenBPException On error
   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    MergeNode node = (MergeNode) entrySocket.getNode();

    NodeSocket nextSocket = node.getDefaultExitSocket();
    if (nextSocket == null)
    {
      String msg = LogUtil.error(getClass(), "No default exit socket present for merge node $0. [{1}]", node.getQualifier(), context);
      throw new EngineException("NoDefaultExitSocket", msg);
    }
    context.setCurrentSocket(nextSocket);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.