Author Topic: Can you create a 'checkbox' tagged value type?  (Read 1765 times)

erobinson

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Can you create a 'checkbox' tagged value type?
« on: October 02, 2019, 12:01:14 am »
I am creating a template to generate a custom document from information stored in EA. One of the values in the document needs to be populated from a 'checkbox' type field. I want the user to see a list of items and it should be possible to select one or more of these items. The selected items should then be displayed in the generated document. The only thing I could think of was tagged values, but if there are any other suggestions, that would be welcome!  :)

philchudley

  • EA User
  • **
  • Posts: 688
  • Karma: +17/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Can you create a 'checkbox' tagged value type?
« Reply #1 on: October 02, 2019, 12:18:18 am »
Hi

There is a tagged value type for check box list, however it is stored internally as a comma delimited string of 0 and 1 (representing unchecked and checked).

When output directly to a word document the tagged value prints as this comma delimited list.

I have worked-around this with a script driven fragment to map the zeros and ones to the check box fields specified in the tagged value description. Full details of this tagged value type can be found in the EA user guide

All the best

Phil
follow me on Twitter

@SparxEAGuru

erobinson

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Can you create a 'checkbox' tagged value type?
« Reply #2 on: October 02, 2019, 01:10:44 am »
Thanks for the quick reply Phil.  :)

I've tried this before and it didn't seem to work as I wanted it to. A value of 'Complete' is displayed in the Tagged Value window if all checkboxes are selected, otherwise a value of 'Incomplete'.

In my example though, when I print the document, 'Complete' is printed and not the comma-delimited list from the database. Is there something specific you need to do? I use {Pkg.valueOf(FMP2)} in my template where FMP2 is the name of my Tagged Value field.

How did you actually manage to map the comma-delimited list using a script driven fragment? Can you perhaps give me an example?

Modesto Vega

  • EA User
  • **
  • Posts: 827
  • Karma: +23/-8
    • View Profile
Re: Can you create a 'checkbox' tagged value type?
« Reply #3 on: October 02, 2019, 09:13:38 pm »
We have solved this problem in the past by creating a UML profile that uses a Specialised Tagged value pointing to an Enumeration.

This does not give you a checkbox but it is very similar.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11849
  • Karma: +460/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can you create a 'checkbox' tagged value type?
« Reply #4 on: October 02, 2019, 09:16:16 pm »
We have solved this problem in the past by creating a UML profile that uses a Specialised Tagged value pointing to an Enumeration.

This does not give you a checkbox but it is very similar.
Problem with an enumeration is that you can only select a single value.
I think for checkbox like functionality you better create a boolean tagged value for each option.

Geert

Modesto Vega

  • EA User
  • **
  • Posts: 827
  • Karma: +23/-8
    • View Profile
Re: Can you create a 'checkbox' tagged value type?
« Reply #5 on: October 03, 2019, 03:36:26 am »
We have solved this problem in the past by creating a UML profile that uses a Specialised Tagged value pointing to an Enumeration.

This does not give you a checkbox but it is very similar.
Problem with an enumeration is that you can only select a single value.
I think for checkbox like functionality you better create a boolean tagged value for each option. By the way, having a tag value for True/Yes and another for False/No both with 2 possible boolean is a bit odd.

Geert
You are probably right but I read the following as an indication of the status (Complete) being calculated on the basis of a series of binary or boolean values.

A value of 'Complete' is displayed in the Tagged Value window if all checkboxes are selected, otherwise a value of 'Incomplete'.

In my example though, when I print the document, 'Complete' is printed and not the comma-delimited list from the database.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8195
  • Karma: +232/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can you create a 'checkbox' tagged value type?
« Reply #6 on: October 03, 2019, 09:36:03 am »
Remember folks,

A Sparx EA Checklist is a TRUE Checklist - look it up!  It is a procedural construct.  Checklist DOES NOT mean a List of Checkboxes  (notwithstanding that it renders as though it is).  The list of Checkboxes is a structural construct.

What is needed is a multi-select bitfield tag value type.  IIRC, I and others have asked for this before.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!