Skip to content
Søren Granfeldt edited this page Sep 26, 2018 · 13 revisions

Supported as of version 1.2.5.2

MRE offers a lot of flexibility in defining rules. However, sometimes you may need a little extra flexibility or even have a need to reuse old code together with MRE.

You can define rules that make calls to one or more other extensions based on the IMVSynchronization interface. By definining Externals in your rule files, you can reference other DLL's and have them be called be a MRE rule.

To define one or more reference to DLL's that MRE can call, you add a section 'Externals' to one of your rule files like below. And in that section, you add one or more 'External' sections.

<Externals>
  <External>
    <ReferenceId>LegacyProvisionCode</ReferenceId>
    <Type>Provision</Type>
    <Filename>mvextensionlegacy.dll</Filename>
  </External>
  <External>
    <ReferenceId>AnotherProvisionCode</ReferenceId>
    <Type>Provision</Type>
    <Filename>anotherlegacyextension.dll</Filename>
  </External>
  <External>
    <ReferenceId>LegacyShouldDeleteCode</ReferenceId>
    <Type>ShouldDeleteFromMV</Type>
    <Filename>mvextensionlegacy.dll</Filename>
  </External>
</Externals>

Each External element must have the following elements -

  • ReferenceId - a unique ID that will used as a reference from a Rule to refer back to the external information. The ReferenceId must be unique across all externals.
  • Type - a type describing what type of entrypoint in the external DLL that is to be called. The value can be either 'Provision' or 'ShouldDeleteFromMV' (ShouldDeleteFromMV is not supported currently, but reserved for future use).
  • Filename - The path to the external DLL that will be loaded and called. You can specify a full path or just the filename. If no full path is specified, then the FIM/MIM extensions folder will be assumed as location. However, please note that if you use an alternative path for rules files, it is assumed that any external files are also located there, unless a full path to the external is specified.

With externals defined, you can now specify a rule that will utilize the external DLL code. The rule should be structured as a normal rule but should have a type of 'External' and a ExternalReferenceId that refers back to the External definition. A sample external rule could look like this -

<Rule>
  <Name>Legacy Provisioning</Name>
  <Action>Provision</Action>
  <Type>External</Type>
  <ExternalReferenceId>LegacyProvisionCode</ExternalReferenceId>
  <TargetManagementAgentName>AD</TargetManagementAgentName>
  <Enabled>true</Enabled>
  <SourceObject>person</SourceObject>
  <TargetObject>person</TargetObject>
</Rule>

Notice that the Type is 'External' and that the ExternalReferenceId refers back to external LegacyProvisionCode in the Externals section above.

With this setup, the DLL 'mvextensionlegacy.dll' is loaded and the Provision entry point in this DLL is called for this rule. Please note, that you can have Conditions for an external rule as well if you only want MRE to call the external under some circumstance. InitialFlows does not apply to external type rules, though. They must handled in the external DLL.

Clone this wiki locally