AnsweredAssumed Answered

Specifying recipient of MailTask as a user's email attribute

Question asked by asinoladro on Jan 6, 2015
Latest reply on Jan 8, 2015 by trademak
Hello,

I have a BPMN flow which contains:

1. A UserTask where someone assigns a user to the process variable 'thirdParty', followed by
2. A MailTask that is supposed to send an email to the email address associated with the thirdParty user object, referring to them by name in the body of the email.

Why I want this: it seems messy and laborious (and not very OO) to carry around a set of process variables giving each property of a single user. Passing these into other flows via CallTask would also be a huge pain.

I tried just putting <activiti:field name="to"><activiti:expression>${thirdParty.email}</activiti:expression></activiti:field> (with ${thirdParty.name} embedded in the 'text' field), but I get an 'Unknown property' error.

Am I required to write a ServiceTask with custom code that takes in a process variable of type User and outputs several process variables? Or is there a more lightweight, out-of-the-box solution?

Thanks
Duncan.

Outcomes