Pass values to activiti bpmn xml file from spring boot file.

Showing results for 
Search instead for 
Did you mean: 
Member II

Pass values to activiti bpmn xml file from spring boot file.


Is there any way to pass external properties to process bpmn file with spring boot from file.

Example : 

<activiti:field name="from">

I am trying to pass the recipient value from file in spring boot application.

I tried with java delegate and expression .

I have passed value to process using process variables but I dont want recipient email address to be passed in process variables or to be persisted to DB.

Is there any way we can pass the recipient variable value to process bpmn file without persisting or as process variable to the process.

I see the following exception 

org.activiti.engine.ActivitiException: Unknown property used in expression: Error task has been created in ${recipient}.

1 Reply
Member II

Re: Pass values to activiti bpmn xml file from spring boot file.

I was able to solve this 

I have used the Java Delegate approach.

1.Create a Java Delegate Class with the properties you need to pass .

2.Generate getters and setters for these properties.

3.Pull the values from or any other property file you are using for your application.

4.For pulling the values in spring boot application I used @Value annotation .

5.Below is how my process bpmn looks like 

<serviceTask id="createMailTask" name="Create Mail Task"
activiti:type="mail" activiti:class="">
<activiti:field name="to"
expression="${testInjectedField.recipient}" />





6.Java Delegate Class

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

public class TestInjectedField implements JavaDelegate {

private String recipient;

public String getRecipient() {
return recipient;

public void setRecipient(String recipient) {
this.recipient = recipient;

public void execute(DelegateExecution execution) throws Exception {