In this new post we are going to discover how to create and configure a new BusinessWorks 6.1 process to connect to our gmail account to download the mail inbox. For this process we are going to do use of the mail palete. I guess many of you know this palete for previous versions of the BusinessWorks software, but we are going to introduce the resource templates. A new element, similar to the previous Shared Resources that allow us to configure our SSL connection to the GMAIL Server.
So, first things first, we need a new account. I create a new gmail account, as you can see here: After that, we are going to work all the way with our new TIBCO BusinesStudio, and we are going to do a little process:
- We’ll have a first Mail Receiver activity that will download all the new mail from your inbox.
- We are going to create a new file from each one of the mails we are donwloading.
- We are going to use a log file to recorded all the downloaded mails.
So, very simple, we design the process using the TIBCO BS (Business Studio) :): The main thing here is the SSL configuration to the pop gmail server. We have to enable the “Confidentiality” option in the Mail Receive activity. After that we have yo provide it a new SSL Client Configuration Resource Template. It’s in this resource when you configurate the Keystore Provider that will store the certificate. So we have to create a new Keystore Provider Resource Template, that link the certificate (in this case we are going to use a JKS keystore) to the Mail activity, so, the link chain is the following: After that, we only start the BW Debugger and send a test mail to our new fresh acocunt, like you can see here: And you could see the process execution in the tester: And you could see the file we created using our BW Process: So we have working our little process, and you can downloaded the source code form here: Download! As a matter of fact we have another way to do the printing out the content of the mails in files, using directly the Mail Receiver configuration, In the advanced tab, we have an option “Write to file”: And we have the following file created, but we lose the bodyText attribute from the output of the Receive Mail activity: