org.mule.modules

mule-module-ms-dynamics-crm-ondemand

config

Namespacehttp://www.mulesoft.org/schema/mule/dynamicscrm
Schema Locationhttp://www.mulesoft.org/schema/mule/dynamicscrm/current/mule-dynamicscrm.xsd  (View Schema)
Schema Version2.0
Minimum Mule Version3.5

Module Overview

Microsoft Dynamics CRM 2011 Ondemand version

This connector allow the integration with MS Dynamics CRM 2011 Ondemand version.

The service of MS Dynamics CRM provide a few operations that are extensible for all the entities (default and custom) created. A list of the default entities can be found in the MSDN documentation link: "http://msdn.microsoft.com/en-us/library/bb959317.aspx

The connector uses Windows Live ID for Authentication.

To use this connector you need a Windows Live ID Account and a Microsoft Dynamics CRM (2011) Online Account

Summary

Configuration
<dynamicscrm:config>
Configure an instance of this module
Message Processors
<dynamicscrm:associate>
Associate a set of entities

<dynamicscrm:create>
Create entity

<dynamicscrm:delete>
Delete entity

<dynamicscrm:disassociate>
Disassociate a set of entities

<dynamicscrm:execute>
Execute a business logic method

<dynamicscrm:retrieve>
Retrieve entity

<dynamicscrm:retrieve-multiple-by-attributes>
This method is deprecated. Use retrieveMultipleByQuery instead
<dynamicscrm:retrieve-multiple-by-query>
Retrieve multiple entities by a query described by and XML

The definition of the Microsoft XML Query Language can be found in the Schema Definition in this link: http://msdn.microsoft.com/en-us/library/bb930489.aspx

The aggregation examples can be found in this link: http://msdn.microsoft.com/en-us/library/gg309565.aspx

<dynamicscrm:update>
Update entity

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:dynamicscrm="http://www.mulesoft.org/schema/mule/dynamicscrm"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/dynamicscrm
               http://www.mulesoft.org/schema/mule/dynamicscrm/current/mule-dynamicscrm.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescriptionJava TypeMIME TypeEncoding
xs:string name Optional. Give a name to this configuration so it can be later referenced.
xs:int authenticationReintents 3 Optional. If the authentication process against Mircosoft Live ID fails the first time the connector can retry the process a defined number of times.

Connection Pool

This connector offers automatic connection management via the use of a connection pool. The pool will act a storage mechanism for all the connections that are in-use by the user of this connector.

Prior to execution of a processor, the connector will attempt to lookup an already established connection and if one doesn't exists it will create one. That lookup mechanism is done in the connection pool via the use of connection variables declared as keys.

The user of the connector can configure the pool by adding a connection-pooling-profile to the connector configuration like this:

    <dynamicscrm:connection-pooling-profile maxActive="10" maxIdle="10"
                             exhaustedAction="WHEN_EXHAUSTED_GROW" maxWait="120" minEvictionMillis="60000" evictionCheckIntervalMillis="30000"/>

The following is a list of connection attributes, each connection attribute can be configured at the config element level or they can also be added to each processor. If they are used at the processor level they get the benefit of full expression resolution.

Connection Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
username The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8

Reconnection Strategies

Reconnection Strategies specify how a connector behaves when its connection fails. You can control how Mule attempts to reconnect by specifying a number of criteria:

With a reconnection strategy, you can better control the behavior of a failed connection, by configuring it, for example, to re-attempt the connection only once every 15 minutes, and to give up after 30 attempts. You can also send an automatic notification to your IT administrator whenever this reconnection strategy goes into effect. You can even define a strategy that attempts to reconnect only during business hours. Such a setting can prove useful if your server is frequently shut down for nightly maintenance.

Configuration

A reconnection strategy that allows the user to configure how many times a reconnection should be attempted and how long to wait between attempts.

    <dynamicscrm:config>
         <reconnect count="5" frequency="1000"/>
    </dynamicscrm:config>
Reconnect Attributes
NameDefault ValueDescription
frequency 2000 Optional. How often (in ms) to reconnect
count 2 Optional. How many reconnection attempts to make

For more information about reconnection strategies in Mule, or even how to write your own custom reconnection strategy please check this section.

Message Processors

<dynamicscrm:associate>

Associate a set of entities

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
entityName Logical name of entity String */* UTF-8
entityId Guid of entity in string form String */* UTF-8
relationshipEntityRoleIsReferenced If the role of the entity is "Referenced" (true) of "Referencing" (false) Boolean */*
relationshipSchemaName The type of relationship String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:related-entities-attributes> List of the attributes of related entities List<Map<String, Object>>
Exception Payloads
Payload ClassDescription
IOrganizationServiceAssociateOrganizationServiceFaultFaultFaultMessage If associate fails

<dynamicscrm:create>

Create entity

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
logicalName A logical name String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:entity> #[payload] Optional. An entity object represented as a map Map<String, Object>
Returns
Return Type Description
String The GUID of the created entity.
Exception Payloads
Payload ClassDescription
IOrganizationServiceCreateOrganizationServiceFaultFaultFaultMessage If create fails
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage If execute fails

<dynamicscrm:delete>

Delete entity

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
logicalName Logical name of the entity to be updated String */* UTF-8
guid The guid of the entity to be retrieved String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Exception Payloads
Payload ClassDescription
IOrganizationServiceDeleteOrganizationServiceFaultFaultFaultMessage If delete fails

<dynamicscrm:disassociate>

Disassociate a set of entities

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
entityName Logical name of entity String */* UTF-8
entityId Guid of entity in string form String */* UTF-8
relationshipEntityRoleIsReferenced If the role of the entity is "Referenced" (true) of "Referencing" (false) Boolean */*
relationshipSchemaName The type of relationship String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:related-entities-attributes> List of the attributes of related entities List<Map<String, Object>>
Exception Payloads
Payload ClassDescription
IOrganizationServiceDisassociateOrganizationServiceFaultFaultFaultMessage If disassociate fails

<dynamicscrm:execute>

Execute a business logic method

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
requestName Logical name of request to be made String */* UTF-8
requestGuid Optional. The guid of the request to me made String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:request-parameters> A collection of parameters to the request in Map form Map<String, Object>
Returns
Return Type Description
Map<String, Object> organization response to execute request
Exception Payloads
Payload ClassDescription
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage If execute fails

<dynamicscrm:retrieve>

Retrieve entity

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
logicalName Name od the entity to be retrieved String */* UTF-8
guid The guid of the entity to be retrieved String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:attributes> Attributes that will be retrieved from the entity specified List<String>
Returns
Return Type Description
Map<String, Object> attributes of specified entity in Map form
Exception Payloads
Payload ClassDescription
IOrganizationServiceRetrieveOrganizationServiceFaultFaultFaultMessage If retrieve fails

<dynamicscrm:retrieve-multiple-by-attributes>

This method is deprecated.
Use retrieveMultipleByQuery instead

Retrieve multiple entities by attributes values and sorting options

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
entityName Name of the entity type String */* UTF-8
count Optional. Number of rows to retrieve Integer */*
pageNumber Optional. Number of page to retrieve Integer */*
pagingCookie Optional. Paging cookie String */* UTF-8
returnTotalRecordCount Optional. If total record count should be returned Boolean */*
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:columns> Columns to retrieve List<String>
<dynamicscrm:attributes> Attributes to filter by List<String>
<dynamicscrm:values> Values of the attributes List<String>
<dynamicscrm:orders> Optional. Ordering fields, key is the name, value is "Ascending" or "Descending" Map<String, String>
Returns
Return Type Description
List<Map<String, Object>> entities retrieved
Exception Payloads
Payload ClassDescription
IOrganizationServiceRetrieveMultipleOrganizationServiceFaultFaultFaultMessage If retrieveMultiple fails

<dynamicscrm:retrieve-multiple-by-query>

Retrieve multiple entities by a query described by and XML

The definition of the Microsoft XML Query Language can be found in the Schema Definition in this link: http://msdn.microsoft.com/en-us/library/bb930489.aspx

The aggregation examples can be found in this link: http://msdn.microsoft.com/en-us/library/gg309565.aspx

This operation can potentially return a large amount of records that might exceed memory capacity.

To prevent this from being a problem, the output of this operation is automatically paginated into an iterable collection of objects. Regardless of the page-size, the iterator will be pushing out registries one at a time and fetching next pages on demand. If you wish to take advantage of the pagination, you must process the output through elements that can handle collections, such as a ForEach scope or DataMapper. In this way, Mule will execute the entire set of registries one at a time, but processing only a batch at a time and thus keeping memory usage from going over limits.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
query Query XML DsqlQuery */*
fetchSize 100 Specify the number of objects that will be returned in each iteration int    
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Returns
Return Type Description
Iterator < Map<String, Object> > A collection: each index contains a list of objects, each object with its own set of properties. It is possible to process it in parts thanks to its pagination.
Exception Payloads
Payload ClassDescription
IOrganizationServiceRetrieveMultipleOrganizationServiceFaultFaultFaultMessage If retrieveMultiple fails

<dynamicscrm:update>

Update entity

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescriptionJava TypeMIME TypeEncoding
config-ref Optional. Specify which configuration to use.
logicalName Logical name of the entity to be updated String */* UTF-8
guid The guid of the entity to be retrieved String */* UTF-8
Connection Parameters
This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation.
username Optional. The username of the Dynamics CRM (example: user@company.onmicrosoft.com). String */* UTF-8
password Optional. The password of the user of the Dynamics CRM. String */* UTF-8
organizationServiceUrl Optional. The organization Url. This can be found inside the Dynamics CRM system. For more detail where to find this parameter check this link String */* UTF-8
Child Elements
NameDefault ValueDescriptionJava Type
<dynamicscrm:attributes-to-update> #[payload] Optional. The attributes that will be updated, in Map form Map<String, Object>
Exception Payloads
Payload ClassDescription
IOrganizationServiceUpdateOrganizationServiceFaultFaultFaultMessage If update fails
IOrganizationServiceRetrieveOrganizationServiceFaultFaultFaultMessage If update fails
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage If execute fails

Message Sources

Transformers