How to get the email Id of the logged user?

One Star

How to get the email Id of the logged user?

Hi all,
I'm working on Talend MDM. In my workflow I have to send email to the logged person.
I added email connector (on Ready status) to one step, activity type is Human. Whenever the user got the workflow in ready state an email should sent to his/her email id.
As Bonita Engine included in Talend MDM, I tried this task on Bonita by giving the following code:
import org.ow2.bonita.util.AccessorUtil
String to=AccessorUtil.getIdentityAPI().getUser(loggedUser).getEmail()
return to
This code successfully executed on Bonita but not on Talend MDM.
Is there any other way to get this task.
Please help me......

Thanks and regards,
Six Stars

Re: How to get the email Id of the logged user?

The Talend job is executed on user's workstation or where? Better describe your scenarion, please....
One Star

Re: How to get the email Id of the logged user?

Hi Ladislav,
It is on developer's work station. Actually the task is we have 8 roles. When the users registered through the administrator, they need to give details like identifier, password,first name, last name, email id and roles assigned.
In my workflow I need to send email for every step when the workflow is in ready state in that particular step. For this I added email connector. In 'to' attribute of email connector I don't want to hard code the email id's. I would like to retrieve the email Id given by the users at registration time.
We can get the username by using 'loggedUser' variable. But I need that user's email Id. As I mentioned in my previous post I implemented the code in Bonita. It is working well on Bonita but I want it on Talend MDM. Please help me....

Thanks and Regards,
Six Stars

Re: How to get the email Id of the logged user?

Which version of Bonita do you use? when looking into Bonita User API documentation at:
In the org.ow2.bonita.facade.identity of client api version 5.3.1 package getEmail method is already deprecated, ContactInfo object is used instead.
it seems to me, that also the getUser method is already deprecated, getUserByName or UUID schould be used instead.
From what I know until now about your issue, you schould check your bonita version running at your workstation (this includes also the user API) against the API which is used by Talend in ./lib folder
I use TOS 4.2.1 and my library versions are 5.2.3 for both bonita client and server.
One Star

Re: How to get the email Id of the logged user?

Thanks for your reply....
Actually we are using a separate Bonita software and the version is 5.4.1.
And in talend the plug-ins we have Bonita of version 5.2.3.
We are getting the code on Bonita of version 5.4.1.
We will checkout the APIs that you provided in the links above.

Thanks and Regards,
Six Stars

Re: How to get the email Id of the logged user?

Well, actually you schould refer to the version of bonita you have installed at workstation.
I am using TOS instead of the MDM product of Talend, but these 2 are similar and in TOS there are 2 bonita related components:
Maybe MDM has more Bonita related components, I don't now and don't want to download and install MDM right now :-) , but here is some proposal of approach how to "hack" the component in way to tell it how to use different library than delivered directly with with Talend product:
I will take for example tBonitaInstantiateProcess. In the Talend product folder you can find the component under ./plugins/org.talend.designer.components.localprovide_XversionoftalendX directory, where are located following files:
zangetsu@helios:/ip/talend/configuration$ ls -l /development/Talend/TOS-All-r60995-V4.2.1/plugins/org.talend.designer.components.localprovider_4.2.1.r60995/components/tBonitaInstantiateProcess

The tBonitaInstantiateProcess_java.xml file is one which can be easily customized to meet your needs. In my version of TOS 4.2.1 there is this:
<IMPORT NAME="Bonita_Client" MODULE="bonita-client-5.2.3.jar" REQUIRED="true" />
<IMPORT NAME="Bonita_Server" MODULE="bonita-server-5.2.3.jar" REQUIRED="true" />

If I am in your position I would replace the definition to be the same as current Bonita system, so in your case it schould look like this:
<IMPORT NAME="Bonita_Client" MODULE="bonita-client-5.4.1.jar" REQUIRED="true" />
<IMPORT NAME="Bonita_Server" MODULE="bonita-server-5.4.1.jar" REQUIRED="true" />

Both files are located already somewhere on the workstation installation or you can download these at:
You schould copy these files in MDM folder ./lib
There are many other imports of external libraries, but these 2 are you are interested in....
So, now Talend MDM component will use same version of bonita libraries as you are running. This approach might help, and I used this for example with components like tSambaPut, tSambaGet, tSambaList, etc. to include newest libraries for working with Windows shares.....but, there could be from my point of view also second issue, the implementation of library could change and you will have to change it also in respect to component. If this will be the case, you schould take a look into files *.javajet in the component directory. These files are source codes of the component. If you are not able to change this behavior by yourself, I would propose to report a bug at Talend bugtracker as new issue and describe this problem.
I already did successful project in Talend which is in UAT tests at our customer and everything is running well. I also discovered about 5 bugs in Talend components and always those were fixed by Talend in very short time. Of course you will not wait until they release the fix in future version, but from the bugtracker you will know that fixed version is already at Talend SVN server and you can download it by yourself weeks before it will be released in official way.
This is what I think could help you......
.....On the other hand, you can forget component based modeling and write Talend User Subroutine in pure Java and get the Emails by this code directly, altough this is not the "right" way how do things in Talend, but in some situations this is still the option, which I found "right" :-)


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend


Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now