Maximo

 View Only
  • 1.  Best way to determinate is MIF import or not

    Posted 21 days ago
    Edited by Andrey Ilinskiy 21 days ago

    Hi!

    I have auto script on attribute init. 

    I need to validate if it is imported via MIF (also as an import in the application) or an attribute initialized in the interface. 

    Unfortunately, I found that when importing an object via MIF, even if the attribute is not in the object structure it always initValue, so my script also acts. 

    "Interactive" does not pass, because when it is imported via application it is also True. 

    Found only that way: 

    IntegrationContext.getCurrentContext().getProperty("action") not in ("Add", "Change", "Sync")*
    *of course with NullPointers validations
    but in some cases it takes up to 30ms. On botch import of 5000 records it is 2,5 minutes.
    So, maybe any other ideas ?



    ------------------------------
    Andrey Ilinskiy
    ------------------------------



  • 2.  RE: Best way to determinate is MIF import or not

    Posted 20 days ago

    Hi Andrey,

    it should be enough to check if IntegrationContext.getCurrentContext() is None. It should be a bit quicker, but it's hard to tell by how much.



    ------------------------------
    Witold Wierzchowski
    ------------------------------