cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti value passing

arif
Champ in-the-making
Champ in-the-making
Hi friends,

I am new of activiti. i want to pass my form property value to service task
this is my form :
<extensionElements>
        <activiti:formProperty id="customerName" name="customerName" type="string" required="true" readable="true" writable="true"></activiti:formProperty>
        <activiti:formProperty id="amount" name="amount" type="long" required="true" readable="true" writable="true"></activiti:formProperty>
      </extensionElements>

now how can i pass value customerName and ammount in service class parameter
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
Form properties are stored as process variables. Just read them using .getVariable("blah") in your service task.

arif
Champ in-the-making
Champ in-the-making
hi,

I want to pass this value to my bean class. and i dont have DelegateExecution in my bean class. so i must have to pass value as parameter.
I can not use .getVariable("blah") there.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
then use expressions and put in in as a parameter

arif
Champ in-the-making
Champ in-the-making
Ya i am putting this as parameter like

<serviceTask

id="createLoanRequest"
name="Create loan request" activiti:expression="${loanRequestBean.newLoanRequest(customerName,amount)}"
activiti:resultVariableName="loanRequest">
</serviceTask>

But it is showing me null pointer exception

Caused by: java.lang.NullPointerException
at org.activiti.spring.test.jpa.LoanRequestBean.newLoanRequest(LoanRequestBean.java:39)

jbarrez
Star Contributor
Star Contributor
LoanRequestBean.java:39 –> what is on line 39? Without code I can't really guess?

I would think you want to pass the variables, right?  Are those two variables actually added to the process instance first?