def get_shared_method_by_id(kbxMethodId, language=AppInfo.DEFAULT_API_LANGUAGE):
     KBXLang.set_preferred_lang(language)
     
     if kbxMethodId < 0:
         privateMethod = SharedMethodWrapper.PRIVATE_METHODS[kbxMethodId]
         if privateMethod is not None:
             privateMethod["kbxMethodLabel"] = str(privateMethod["kbxMethodLabel"])
             return privateMethod
         
     return SharedMethod.get_shared_method_by_id(kbxMethodId, language)
    def get_shared_method_by_id(kbxMethodId,
                                language=AppInfo.DEFAULT_API_LANGUAGE):
        KBXLang.set_preferred_lang(language)

        if kbxMethodId < 0:
            privateMethod = SharedMethodWrapper.PRIVATE_METHODS[kbxMethodId]
            if privateMethod is not None:
                privateMethod["kbxMethodLabel"] = str(
                    privateMethod["kbxMethodLabel"])
                return privateMethod

        return SharedMethod.get_shared_method_by_id(kbxMethodId, language)
Exemple #3
0
 def update_kbx_method(self, kbxMethodId):
     '''
     Returns: 
     None: Method Removed
     True: Method Active
     False: Method Inactive
     '''
     hasKBXMethod = self.__apiController.has_kbx_method(kbxMethodId)
     if not hasKBXMethod:
         raise AutomationException(11602, "Method ID provided: " + str(kbxMethodId))
     
     try:
         kbxMethod = SharedMethod.get_shared_method_by_id(kbxMethodId, language=AppInfo.DEFAULT_API_LANGUAGE)
     except SystemException as se:
         if se.value["returnValue"] == 1608:
             self.__methodController.delete(kbxMethodId)
             return None # None: Method Removed
         else:
             raise AutomationException(11601, "Unexpected returnValue when get method: " + str(se))
     else:
         self.__methodController.update(kbxMethod)
         return kbxMethod["kbxMethodStatus"] == SharedMethod.METHOD_STATUS_ACTIVE # True: Active, False: Inactive