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 is triggered by any data record event and then triggers the corresponding actions. In this case, the process can only access the mailbox of the user currently logged in.

Use with timer events

There is no interactive user for timer events. In this case, a predefined user can be selected in a dialog in whose user context of the Microsoft Exchange server the desired further process actions are carried out.

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. For example, employees can be assigned tasks or appointments for customer visits, resubmissions, etc. directly from a customer management system. Real-time access to the Microsoft Exchange server means that appointments are always up to date.

User selection

Click here for detailed information about the settings in this dialog.

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