DA# Macro_v2.13_20221217 Deployment

Distribute DA# Macro_v2.13_20221217 that corrects two errors related to reverse. The corrected errors are:

  • [Fix] Reverse: Modify Attribute attribute values specified in template (standardization, information protection, information protection level, encryption, scramble)
  • [Fix] Reverse: Fixed a bug where the information protection level value was not set

For reference, the DA# Macro introduction (DA# Macro(1): DA#, DA# API, DA# Macro Overview – Productivity Skill (prodskill.com)) was explained based on v2.12.

1. Bug phenomena

1.1. Reverse: Push the value of the Attribute attribute specified in the template

This is a bug in which the value specified in the “Column” sheet of the template file is pushed back one by one. For example, this bug is reproduced when the following is entered in the template file.

template에 지정한 값 밀림
Push the value specified in the template

Values that can be entered for each attribute are as follows.

  • Standardization: Only one of the fixed values can be entered
  • Whether information is protected: Only one of Y/N can be entered
  • Information Protection Level: String
  • Encryption: Only one of Y/N can be entered
  • scramble: string

Since the values that can be entered are different, it is not set normally if pushed one by one.

1.2. Reverse: Information protection level value not set

This is a bug in which the value is not set in the data model even though the “Information Security Level” value is entered in the image above. Since only one of Y/N can be input for the “information protection level” value, it is not entered ignoring the string value.

2. Modifications

2.1. [Fix] Reverse: Modifying the Attribute value specified in the template

The code (some excerpts) before the modDAConstType module change is as follows.

'----------------------------------------------------------------------------------------------------
'Reverse Attribute property Index
Public Const DA_REVATTR_Sequence_IDX As Long = 0
Public Const DA_REVATTR_ModelName_IDX As Long = 1
Public Const DA_REVATTR_EntityName_IDX As Long = 2
Public Const DA_REVATTR_Name_IDX As Long = 3
...
Public Const DA_REVATTR_Inclusive_IDX As Long = 27
Public Const DA_REVATTR_StandardType_IDX As Long = 28
Public Const DA_REVATTR_PrivacyAct_IDX As Long = 29
Public Const DA_REVATTR_PrivacyGrade_IDX As Long = 30
Public Const DA_REVATTR_Encryption_IDX As Long = 31
Public Const DA_REVATTR_EncryptionMethod_IDX As Long = 32

I commented out DA_REVATTR_Inclusive_IDX and reduced the constant value by one after that. This constant value indicates the column order of the “Column” sheet of the reverse template file.

'----------------------------------------------------------------------------------------------------
'Reverse Attribute property Index
Public Const DA_REVATTR_Sequence_IDX As Long = 0
Public Const DA_REVATTR_ModelName_IDX As Long = 1
Public Const DA_REVATTR_EntityName_IDX As Long = 2
Public Const DA_REVATTR_Name_IDX As Long = 3
...
'Public Const DA_REVATTR_Inclusive_IDX As Long = 27 '2022-12-17 주석 처리(Reverse에는 사용하지 않도록 처리함)
Public Const DA_REVATTR_StandardType_IDX As Long = 27
Public Const DA_REVATTR_PrivacyAct_IDX As Long = 28
Public Const DA_REVATTR_PrivacyGrade_IDX As Long = 29
Public Const DA_REVATTR_Encryption_IDX As Long = 30
Public Const DA_REVATTR_EncryptionMethod_IDX As Long = 31

2.2. [Fix] Reverse: Fixed a bug where the information protection level value was not set

In the SetValue procedure of the CDAAttribute class, the information security level value was converted into the GetBoolean function. The information protection level is not a value to be set as Y/N, and the input string should be set as it is, but the value was not set because the GetBoolean function was executed unnecessarily.

I modified the code as follows.

'DA# Attribute 개체에 값 설정
Public Sub SetValue(ByRef aodAttribute As Modeler5.Attribute)
    ....
    '-- 변경 전 코드
    arrAttr(Modeler5.ATR_PRIVACYGRADE) = GetBoolean(Me.m_s정보보호등급)

    '-- 변경 후 코드
    arrAttr(Modeler5.ATR_PRIVACYGRADE) = Me.m_s정보보호등급

For reference, the GetBoolean function is implemented as follows.

'Text(Y, N)의 Boolean value 변환(True, False)
Public Function GetBoolean(aValue As String) As Boolean
    GetBoolean = IIf(UCase(Trim(aValue)) = "Y", True, False) 'Y=True, Else=False
End Function

3. Download DA# Macro_v2.13_20221217

A bug-fixed version has been uploaded to github. You can download it from the URL below.

https://github.com/DAToolset/DA-Macro/raw/main/DA%23%20Macro_v2.13_20221217.xlsm

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish