Connector for Microsoft Exchange in Processes

Access to the objects on the Microsoft Exchange Server can be achieved through processes. The following scenarios are distinguished:

Use as an interactive user

A process is triggered by any record event and then initiates the corresponding actions. In this case, the process can access only the mailbox of the currently logged-in user.

Using Timer Events

There is no interactive user for timer events. In this case, a predefined user can be selected in a dialog box, and the desired additional process actions are performed within that user's context on the Microsoft Exchange Server.

If this user has the appropriate permissions for shared mailboxes, the corresponding actions can also be performed in those mailboxes. Such actions could include creating a task or an appointment. For example, this allows employees to be assigned tasks or appointments for client visits, follow-ups, etc., directly from a customer management system. Thanks to real-time access to the Microsoft Exchange server, all appointments are always up to date.

User Selection

You can find all the information about the settings in this dialog box here.

Groovy

The library provides a number of classes and methods under the "Exchange" category that can be used in the Groovy environment. Here are a few brief examples:

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 an email to an 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 a 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 an 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
Set Up a Connection
Integrating Microsoft Exchange Data into Applications