Book a Demo

Author Topic: Import/Export Working set?  (Read 6016 times)

adepreter

  • EA User
  • **
  • Posts: 190
  • Karma: +10/-10
    • View Profile
Import/Export Working set?
« on: June 01, 2020, 02:59:39 am »
Hello,
Does anybody know how to export and import working sets?
Or, as an alternative, do you know where this data is stored?

I can't find this in "Export reference data"
Nor in AppData
Nor in the registry

So I guess in must be somewhere in the database?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Import/Export Working set?
« Reply #1 on: June 01, 2020, 07:27:17 pm »
Working sets are stored in the model in t_document

This code is how I get them out

Code: [Select]
        public List<WorkingSet> workingSets
        {
            get
            {
                List<WorkingSet> workingSetList = new List<WorkingSet>();
                string getWorkingSets = "select d.docid, d.DocName,d.Author from t_document d where d.DocType = 'WorkItem' order by d.Author, d.DocName";
                XmlDocument workingSets = this.SQLQuery(getWorkingSets);
                foreach (XmlNode workingSetNode in workingSets.SelectNodes("//Row"))
                {
                    string name = string.Empty;
                    string id = string.Empty;
                    string ownerFullName = string.Empty;
                    foreach (XmlNode subNode in workingSetNode.ChildNodes)
                    {
                        switch (subNode.Name.ToLower())
                        {
                            case "docid":
                                id = subNode.InnerText;
                                break;
                            case "docname":
                                name = subNode.InnerText;
                                break;
                            case "author":
                                ownerFullName = subNode.InnerText;
                                break;
                        }
                    }
                    User owner = this.users.Find(u => u.fullName.Equals(ownerFullName, StringComparison.InvariantCultureIgnoreCase));
                    workingSetList.Add(((Factory)this.factory).createWorkingSet(name, id, owner));
                }
                return workingSetList;
            }
        }

Geert

adepreter

  • EA User
  • **
  • Posts: 190
  • Karma: +10/-10
    • View Profile
Re: Import/Export Working set?
« Reply #2 on: June 01, 2020, 07:34:09 pm »
Thank you Geert!

Very useful!

And you answered at 7:30 in the morning on a public holiday :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Import/Export Working set?
« Reply #3 on: June 01, 2020, 07:47:08 pm »
Thank you Geert!

Very useful!

And you answered at 7:30 in the morning on a public holiday :-)
That must be some kind of forum server time. It was more like 11:15 CEST

Geert