none
Disconnect when anchor value is flowed outbound RRS feed

  • Question

  • I have an extensible MA(iSeries DB2) with no primary key.  I would like to update the schema, but other people use it.  Therefor my anchor value is the accountname.  This is fine until people change thier name.

    So I am left wanting to disconnect when the anchor value is flowed outbound.  I have the code:

            void IMASynchronization.MapAttributesForExport (string FlowRuleName, MVEntry mventry, CSEntry csentry)
            {
                if (FlowRuleName == "cd.person:userid<-mv.person:accountName")
                {
                    /// On an outbound sync, if the userid is updated, just disconnect it. 
                    /// The deprovisioning options are set to stage a delete on the next 
                    /// export run.  A new cs object should be provisioned (in theory).
                    
                    if (csentry["userid"].IsPresent && csentry["userid"].Value != mventry["accountName"].Value)
                    {
                        mventry.ConnectedMAs[csentry.MA.Name].Connectors.ByDN[csentry.DN].Deprovision();
                    }
                }
                else
                {
                    throw new EntryPointNotImplementedException();
                }
            }

    However, when I try to set up the rules extention, I get an error "userid is read only". I realize this is because it's an anchor and FIM is protecting me from myself, however my MA uses CSV format and I don't with to rewrite it.  Is there a way around this?


    Alex Trusler Software Developer

    Thursday, May 31, 2012 12:40 AM

Answers

  • Actually You can't do this action in MA extension code - You have to do this check and disconnect action in Metaverse extension - Provision method. There You will be able to deprovision this object. 
    • Marked as answer by Alex Trusler Thursday, May 31, 2012 5:44 PM
    Thursday, May 31, 2012 9:14 AM

All replies

  • Actually You can't do this action in MA extension code - You have to do this check and disconnect action in Metaverse extension - Provision method. There You will be able to deprovision this object. 
    • Marked as answer by Alex Trusler Thursday, May 31, 2012 5:44 PM
    Thursday, May 31, 2012 9:14 AM
  • Thank you, Tomasz.  I will give it a shot.

            void IMVSynchronization.Provision (MVEntry mventry)
            {
                ConnectedMA domusermapma;
                CSEntry csentry;
    
                domusermapma = mventry.ConnectedMAs["DOMUSRMAPMA"];
                
                if (domusermapma.Connectors.Count == 1)
                {
                    csentry = domusermapma.Connectors.ByIndex[0];
                    if (csentry["userid"].IsPresent && csentry["userid"].Value != mventry["accountName"].Value)
                    {
                        mventry.ConnectedMAs[csentry.MA.Name].Connectors.ByDN[csentry.DN].Deprovision();
                    }
                }
    
            }	


    Alex Trusler Software Developer

    Thursday, May 31, 2012 3:13 PM
  • I had to reprovision too because the detected rule entry still thought it was good to go!

            void IMVSynchronization.Provision (MVEntry mventry)
            {
                ConnectedMA domusermapma = mventry.ConnectedMAs["DOMUSRMAPMA"];
    
                if (domusermapma.Connectors.Count > 0)
                {
                    CSEntry csentry = domusermapma.Connectors.ByIndex[0];
                    if (csentry["userid"].IsPresent && csentry["userid"].Value != mventry["accountName"].Value)
                    {
                        mventry.ConnectedMAs[csentry.MA.Name].Connectors.ByDN[csentry.DN].Deprovision();
    
                        CSEntry domCsentry = domusermapma.Connectors.StartNewConnector("person");
                        domCsentry["userid"].Value = mventry["accountName"].Value;
                        domCsentry.CommitNewConnector();
                    }
                }
            }


    Alex Trusler Software Developer

    Thursday, May 31, 2012 7:19 PM