Connector for Microsoft Exchange in Processes

The objects of the Microsoft Exchange server can be accessed in Processes. We distinguish between the following scenarios:

Use as an interactive user

A process will be initiated through an arbitrary initiating data record event and will then start the corresponding actions. In this case, the process can only access the mailbox of the user currently logged in.

Use with timer events

In the case of timer events, there are no interactive users. In this case, a predefined user can be selected in a dialog, where the further workflow actions are executed in their user context on the Microsoft Exchange server. If this user has appropriate permissions for shared mailboxes, appropriate actions can also be performed in these mailboxes. Such actions could involve creating a task or an appointment. In this way, for example, employees can be given tasks or appointments for customer visits, resubmissions, etc. directly from a CSM. Real-time access to the Microsoft Exchange server means that appointments are always up to date.

User selection

Default user from portal settings

If the process has recognized the selected data group as a connection to the Microsoft Exchange server, a user can be defined here in whose context the queries will be performed. Only users who are assigned to an Exchange user account can be selected.

Static users

With the "Login as static user" option, the "Select user" link will be activated. Clicking on this link opens a dialog that allows users from the data source configuration that have been created and assigned to Exchange users to be selected. In the lower pane, enter the connection data to the Microsoft Exchange server.

User from system value

With the User switch action users can be switched during the process. It should be noted that a valid user mapping must exist in the Exchange configuration. In addition, appointments and tasks can be created, and emails generated via process actions. Through the user switch action, the user can be changed during the process. If a static user is assigned both within the data group and the process, the user of the data group has priority.

A user who publishes a process with a user switch action must have the corresponding permissions. Normally, the user will have these by belonging to the Administrators user group.

Groovy

A number of classes and methods are available in the library via the "Exchange" category, which can be used in the Groovy environment. Here are some examples in short form:

Save email locally

import de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtils
				
def strMessageId   = g_request.get('qs_id')
def msgUtil        = ExchangeUtils.getMessageUtil()
def strHref        = msgUtil.getHrefById(strMessageId)
def mailboxUtil    = ExchangeUtils.getMailboxUtil()
def strMailBoxName = mailboxUtil.getUserAccount(g_session?.user?.guid).exchangeMailbox
def strMailName    = strMessageId[strMessageId.lastIndexOf("-") + 1..-1]
def mail           = new File("C:/${strMailName}.eml")
				
msgUtil.saveMessageAsEML(strMailBoxName, strHref, mail)

Save email in Intrexx data group

import de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtils


def conn = g_dbConnections.systemConnection

def strMailBoxName = "ExTest.2"
def strMessageId   = g_request.get('qs_id')
def msgUtil        = ExchangeUtils.getMessageUtil()
def strHref        = msgUtil.getHrefById(strMessageId)

def strMailName = strMessageId[strMessageId.lastIndexOf("-") + 1..-1]
def mail 	    = new File(g_dirWorkflowTmp, "${strMailName}.eml")

msgUtil.saveMessageAsEML(strMailBoxName, strHref, mail)

def iMaxLid = g_dbQuery.executeAndGetScalarValue(conn, "SELECT MAX(LID) FROM XDATAGROUP445CAD5D", 0)

g_dbQuery.executeUpdate(conn,
"INSERT INTO XDATAGROUP445CAD5D (LID) VALUES (?)")
{
	setInt(1, iMaxLid + 1)
}

g_dgFile.move(guid: "353CB9686F4FF3CAC9FD8894AAC7C9611BA58625", id: iMaxLid + 1, file: mail, name: "${strMailName}.eml", 
	deleteAlways: true, triggerWorkflow: false)

Create new folder

import de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtils

def mailboxUtil         = ExchangeUtils.getMailboxUtil()
def strParentFolderName = g_request.get("qs_parentFolder")
def strNewFolderName    = g_request.get("qs_newFolder")

mailboxUtil.createFolder(strNewFolderName, strParentFolderName , "urn:content-classes:mailfolder")

Rename existing folder

import de.uplanet.lucy.server.businesslogic.exchange.util.ExchangeUtils

def mailboxUtil      = ExchangeUtils.getMailboxUtil()
def strOldFolderName = g_request.get("qs_oldFolder")
def strNewFolderName = g_request.get("qs_editFolder")

mailboxUtil.updateFolderName("${strOldFolderName}", "${strNewFolderName}")

More information

Installation
Setting up the connection
Integrate Microsoft Exchange data into applications