use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class DefaultStartFormHandler method parseConfiguration.
@Override
public void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse) {
super.parseConfiguration(activityElement, deployment, processDefinition, bpmnParse);
ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();
String formKeyAttribute = activityElement.attributeNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "formKey");
if (formKeyAttribute != null) {
this.formKey = expressionManager.createExpression(formKeyAttribute);
}
if (formKey != null) {
processDefinition.setStartFormKey(true);
}
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class CmmnElementHandlerTest method setup.
@Before
public void setup() {
modelInstance = Cmmn.createEmptyModel();
definitions = modelInstance.newInstance(Definitions.class);
definitions.setTargetNamespace("http://camunda.org/examples");
modelInstance.setDefinitions(definitions);
caseDefinition = createElement(definitions, "aCaseDefinition", Case.class);
casePlanModel = createElement(caseDefinition, "aCasePlanModel", CasePlanModel.class);
context = new CmmnHandlerContext();
CaseDefinitionEntity caseDefinition = new CaseDefinitionEntity();
caseDefinition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
context.setCaseDefinition(caseDefinition);
ExpressionManager expressionManager = new ExpressionManager();
context.setExpressionManager(expressionManager);
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class ProcessEngineConfigurationImpl method initExpressionManager.
protected void initExpressionManager() {
if (expressionManager == null) {
expressionManager = new ExpressionManager(beans);
}
// add function mapper for command context (eg currentUser(), currentUserGroups())
expressionManager.addFunctionMapper(new CommandContextFunctionMapper());
// add function mapper for date time (eg now(), dateTime())
expressionManager.addFunctionMapper(new DateTimeFunctionMapper());
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class HumanTaskPlanItemHandlerTest method testExpressionManager.
@Test
public void testExpressionManager() {
// given: a plan item
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
HumanTaskActivityBehavior behavior = (HumanTaskActivityBehavior) activity.getActivityBehavior();
ExpressionManager expressionManager = behavior.getExpressionManager();
assertNotNull(expressionManager);
assertEquals(context.getExpressionManager(), expressionManager);
}
use of org.camunda.bpm.engine.impl.el.ExpressionManager in project camunda-bpm-platform by camunda.
the class ItemHandler method initializeCaseControlRule.
protected CaseControlRule initializeCaseControlRule(ConditionExpression condition, CmmnHandlerContext context) {
Expression expression = null;
if (condition != null) {
String rule = condition.getText();
if (rule != null && !rule.isEmpty()) {
ExpressionManager expressionManager = context.getExpressionManager();
expression = expressionManager.createExpression(rule);
}
}
return new CaseControlRuleImpl(expression);
}
Aggregations