Profile picture for user RBeddoe

I have this function:

this.TestReport = function(oDatabase){
            
            var oXmlWriter = Context.createXMLOutputObject("products.xml", "products"); 
            
            var models = oDatabase.Find(Constants.SEARCH_GROUP);
            
            var oProducts = [];

                       var oProductData = {    
                                                isnull:models.length
                                          }
                        oProducts.push(oProductData);
                        var oProductElem = oCXML.AddElement(oProductData,oXmlWriter.getRootElement(),"product", oXmlWriter);
            
                oXmlWriter.WriteReport();
            
        }

(oCXML is a custom object that contains a function for adding elements)

When I run this, the output reports the length of the 'models' variable as being 0 (zero). Indicating that it has not found any groups in the database. I assure you, there are groups in the database :).

This works fine in Aris Architect. What am I missing?

Thanks,

Rick Beddoe

Cargill Aris Technical Analyst

Minneapolis, MN, USA

by Rick Beddoe Author
Posted on Wed, 08/15/2012 - 20:53

Well, I just could not get Database.Find to work, so here is my workaround:

var rootGroup = oDatabase.RootGroup();
var oChildren = rootGroup.Childs(true);
var group = JSLINQ(oChildren)
           .Where(function(grp){return grp.Name(oLocale) == "Organization Hierarchy";})
           .ToArray()[0];           
                 

As you can see, I am using JSLINQ to quickly find the desired group from all 'Childs' groups.

If anyone has a better idea, please feel free to share.

Thanks,

Rick Beddoe

Cargill Aris Technical Analyst

Minneapolis, MN, USA

 

 

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock