Package org.camunda.bpm.engine.delegate

Examples of org.camunda.bpm.engine.delegate.Expression


  @SuppressWarnings("unchecked")
  protected <T> T executeExpression(String expression) {

    final TestVariableScope varScope = new TestVariableScope();

    final Expression compiledExpression = processEngineConfiguration.getExpressionManager()
      .createExpression(expression);

    return (T) processEngineConfiguration.getCommandExecutorTxRequired()
      .execute(new Command<Object>() {
        public Object execute(CommandContext commandContext) {
          return compiledExpression.getValue(varScope);
        }
      });
  }
View Full Code Here


    assertNotNull(sentryDeclaration);

    CmmnIfPartDeclaration ifPartDeclaration = sentryDeclaration.getIfPart();
    assertNotNull(ifPartDeclaration);

    Expression condition = ifPartDeclaration.getCondition();
    assertNotNull(condition);
    assertEquals(expression, condition.getExpressionText());

    assertTrue(sentryDeclaration.getOnParts().isEmpty());

  }
View Full Code Here

    assertNotNull(sentryDeclaration);

    CmmnIfPartDeclaration ifPartDeclaration = sentryDeclaration.getIfPart();
    assertNotNull(ifPartDeclaration);

    Expression condition = ifPartDeclaration.getCondition();
    assertNotNull(condition);
    assertEquals(firstExpression, condition.getExpressionText());

    // the second condition will be ignored!

    assertTrue(sentryDeclaration.getOnParts().isEmpty());
View Full Code Here

   */
  public static ExecutableScript getScriptFormSource(String language, String source, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
    ensureNotEmpty(NotValidException.class, "Script language", language);
    ensureNotNull(NotValidException.class, "Script source", source);
    if (isDynamicScriptExpression(language, source)) {
      Expression sourceExpression = expressionManager.createExpression(source);
      return getScriptFromSourceExpression(language, sourceExpression, scriptFactory);
    }
    else {
      return getScriptFromSource(language, source, scriptFactory);
    }
View Full Code Here

   */
  public static ExecutableScript getScriptFromResource(String language, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
    ensureNotEmpty(NotValidException.class, "Script language", language);
    ensureNotEmpty(NotValidException.class, "Script resource", resource);
    if (isDynamicScriptExpression(language, resource)) {
      Expression resourceExpression = expressionManager.createExpression(resource);
      return getScriptFromResourceExpression(language, resourceExpression, scriptFactory);
    }
    else {
      return getScriptFromResource(language, resource, scriptFactory);
    }
View Full Code Here

  public void initializeFormKey() {
    isFormKeyInitialized = true;
    if(taskDefinitionKey != null) {
      TaskDefinition taskDefinition = getTaskDefinition();
      if(taskDefinition != null) {
        Expression formKey = taskDefinition.getFormKey();
        if(formKey != null) {
          this.formKey = (String) formKey.getValue(this);
        }
      }
    }
  }
View Full Code Here

    ProcessDefinitionEntity processDefinition = Context
            .getProcessEngineConfiguration()
            .getDeploymentCache()
            .findDeployedProcessDefinitionById(processDefinitionId);

    Expression formKeyExpression = null;

    if (taskDefinitionKey == null) {
      // TODO: Maybe add getFormKey() to FormHandler interface to avoid the following cast
      FormHandler formHandler = processDefinition.getStartFormHandler();

      // Sorry!!! In case of a custom start form handler (which does not extend
      // the DefaultFormHandler) a formKey would never be returned. So a custom
      // form handler (for a startForm) has always to extend the DefaultStartFormHandler!
      if (formHandler instanceof DefaultStartFormHandler) {
        DefaultStartFormHandler startFormHandler = (DefaultStartFormHandler) formHandler;
        formKeyExpression = startFormHandler.getFormKey();
      }

    } else {
      TaskDefinition taskDefinition = processDefinition.getTaskDefinitions().get(taskDefinitionKey);
      formKeyExpression = taskDefinition.getFormKey();
    }

    String formKey = null;
    if (formKeyExpression != null) {
      formKey = formKeyExpression.getExpressionText();
    }
    return formKey;
  }
View Full Code Here

      name = definition.getName();
    }

    if (name != null) {
      ExpressionManager expressionManager = context.getExpressionManager();
      Expression nameExpression = expressionManager.createExpression(name);
      taskDefinition.setNameExpression(nameExpression);
    }

  }
View Full Code Here

    HumanTask definition = getDefinition(element);

    String formKey = definition.getCamundaFormKey();
    if (formKey != null) {
      ExpressionManager expressionManager = context.getExpressionManager();
      Expression formKeyExpression = expressionManager.createExpression(formKey);
      taskDefinition.setFormKey(formKeyExpression);
    }
  }
View Full Code Here

      assignee = definition.getCamundaAssignee();
    }

    if (assignee != null) {
      ExpressionManager expressionManager = context.getExpressionManager();
      Expression assigneeExpression = expressionManager.createExpression(assignee);
      taskDefinition.setAssigneeExpression(assigneeExpression);
    }
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.delegate.Expression

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.