Developing a Process
Add a New Service - GetCurrentDateTime
On the left, in the Services tab, open up “Date and Time Services” and find the “GetCurrentDateTime” Service. Drag and drop this service into the canvas and connect the start node to the new Services as shown below.
Add a New Service - SendEmail
Now find the “SendEmail” service from “Email Services” workshop. Notice you can expand the SendEmail service also. This shows a pre-configured service based on the email profiles you have set up in the system (via Profile and Configuration). Drag and drop the "Default" profile (or whichever you've already configured) under the SendEmail service into the process canvas.
Drag it under the GetCurrentDateTime service and connect them as shown below. Also connect SendEmail service to Terminate.
Selecting a service on canvas and hitting F2 allows you to rename it. This can also be accomplished by right-clicking and selecting “Rename”. Assigning meaningful names to services greatly improves the readability of a process.
The name of a service cannot contain spaces.
Service Canvas - SendEmail
Now double click on 'SendEmail' service to open up the Service Canvas for it. This is where we provide the parameters like To, Cc, and Bcc required to send out an email. Some of these parameters are pre filled based on the "Default" email profile you've selected.
Take a moment to familiarize yourself with the Service Canvas. This is where you provide input parameters for the selected service.
Sections on this screen that were not covered in Process Canvas are briefed below.
To your left, you will find:
Configuration Settings: These are separated into different lists.
Configuration → Systems
These are Environment wide variables that can be set up for the system. It is useful for defining a variable used in the system that can easily be changed later. The values of these may change, but the structure of what variables can exist will likely not change.
Configuration → Applications
These are the same as the configuration variables for the system, except the structure can easily be changes as well as the values of those variables. If you were creating a process and were referencing a variable in lots of places, but that value could change in the future, you would add one of these configuration variables and reference it for an easy change in the future.
EPUser → Entity
This allows quick access to the current logged in user's EPUser entity properties.
The service designer section in the middle has two major parts:
Service Tree: The top half of the service designer lists parameters for the selected service that you need to specify so it could run properly. Some of the parameters may have default values filled in and some may not. Some parameters may be required. Some services could accept complex inputs and others could be very simple. Further documentation is available for specific services if it is not clear how it functions or what inputs are needed.
Value Box: The bottom half of the service is used to specify a value for the parameter selected above. Value can be typed in, or could be dragged and dropped from Configuration Settings on left or Recommended Values to the right.
To your right, you will find:
This area displays the projected output nodes from services preceding the selected one on the canvas. It also suggests other relevant values that may be applicable to the selected parameter. Sometimes, depending on the service, it may provide a list of accepted values for the parameter.
Back to our example, we will be configuring the SendEmail service in the Service Canvas we just reviewed. Select the “From” parameter from the Service Tree. Notice the default value from Configuration Settings in XSLT format. Although some parameters like SMTPServer, UserName, Password etc have been pre-filled for you; there are others like To, EmailSubject, EmailBody that you are required to enter.
Enter your email address for “To” parameter.
Now select the “EmailSubject” parameter.
For its value, let's use the output from a previous defined service. Remember there is a GetCurrentDateTime service prior to this email service? In the Recommended Values on the right, expand GetCurrentDateTime service to see the output returned by it. Pick a format you like and drag-drop it in the value box at the bottom.
Now highlight “EmailBody” parameter and type yourself a message and again drag-drop a date value next to your message.
An asterisk in the Service/Process canvas tab means that the work has not been saved. Save and Close. You will be directed back to Process Canvas.
Run Process in steps
Save canvas if necessary. Click on Reset. Make a habit of doing this every time as starting the process from the middle may not work since data available to each service is dependent on its preceding services.
Now “Run in Step” and notice the change in color:
Salmon signifies the service that would be executed next.
Green denotes services that have been executed.
Run in Step until GetCurrentDateTime service turns green. Go to the Output Data tab on left and expand the output node to see the values returned by it.
Select the GetCurrentDateTime service again and Run in Step. See how the Output Data changes.
Continue with 'Run in step' until the SendEmail service turns green. See the output in Output Data section.
If you are connected to the internet, you should have received an email by now! Verify its Subject and Body.
Now go back into the SendEmailToMyself service and make more changes to it. Add another time field, perhaps.
Save. Close. Reset. Run in Step. Observe the changes in Output Data section.
Advanced Exercise: If you're familiar with HTML, you can bring in any HTML formatted text and use it in the “EmailBody” field. You can even drag and drop date fields into various parts of the HTML layout. Practice with cursor positioning for accurate placement. Create an email with HTML formatting. Get as creative as you can.