Book a Demo

Author Topic: Populate checklist with model elements  (Read 5246 times)

vroomado

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Populate checklist with model elements
« on: March 03, 2017, 11:21:07 am »
Dear All,

The checklist artifact tutorial provides a good example of the use of a checklist in completing a procedure or a set of tasks, a lot like BPMN only in list form.

http://www.sparxsystems.com.au/enterprise_architect_user_guide/13.0/model_domains/checklart.html

I have created a number of BPMN activity elements and would like to use them in a procedure checklist, thus having a procedure checklist made from the procedure elements.

Using the tutorial example, there would be six elements, "Check Stock in Storage" to "If Stock required, draw up new Order".  This would allow for the activities to be defined in the model and used in the checklist rather than redefined in the checklist, e.g. drag an element onto the checklist object like you drag a folder onto a document model.  In addition, as they are standard elements,they could be linked, contain detail instructions and be included in a procedures document.

Has anyone done this?  Is this doable?  All comments and recommendations welcome!

Thanks very much, vroomado

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Populate checklist with model elements
« Reply #1 on: March 03, 2017, 11:35:33 am »
If you create a checklist and look at its tagged values, you will notice that its checkboxes are defined by some very simple XML:

Code: [Select]
<Checklist>
    <Item Text="One" Checked="False"/>
    <Item Text="Two" Checked="False"/>
    <Item Text="Three" Checked="False"/>
    <Item Text="Four" Checked="False"/>
</Checklist>

It shouldn't be hard to write a script to iterate diagram objects and create some XML in the same format.
The Sparx Team
[email protected]

Echo

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Automation with checklist
« Reply #2 on: January 07, 2019, 07:46:12 pm »
Is it possible to do Automation with Checklist Artifact? Checklist has type as Checklist and Stereotype as Checklist. But in VB scripting, this type cannot be found under EA class. I want to add a new checklist and also search for existing checklist. Any advice would be welcome!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Populate checklist with model elements
« Reply #3 on: January 07, 2019, 09:34:12 pm »
I had no issue creating a checklist with this Python snippet:
Code: [Select]
root = rep.models.getat(0)
view = root.packages.getAt(0)
e = view.elements.addNew("cl", "Checklist")
e.stereotypeEx = "Checklist"
e.update

q.

Echo

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Populate checklist with model elements
« Reply #4 on: January 07, 2019, 11:07:08 pm »
Thanks1 Now I use Collection class to do Elements.AddNew(Name, "Checklist") by VB. Problem solved.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Populate checklist with model elements
« Reply #5 on: January 08, 2019, 08:58:12 am »
I had no issue creating a checklist with this Python snippet:
Code: [Select]
e = view.elements.addNew("cl", "Checklist")

As discussed elsewhere on this forum, this is ambiguous. If you don't want your code to break when a new "Checklist" type is added always use the fully qualified name.

Code: [Select]
e = view.elements.addNew("cl", "EAUML::Checklist")

Echo

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Populate checklist with model elements
« Reply #6 on: January 08, 2019, 06:40:19 pm »
Thank you for the tip!