gobravedave / Enterprise-Architect

scripts and other code snippets to extend Sparxs Enterprise Architect
BSD 2-Clause "Simplified" License
51 stars 12 forks source link

Error when executing with 'Generate PlantUML Script' in the latest MyModel.EAP #16

Closed Takashi-K-TakaTech closed 1 year ago

Takashi-K-TakaTech commented 1 year ago

Error when executing the following sequence diagram with 'Generate PlantUML Script' in the latest MyModel.EAP.

Error generating procedure:

  1. Create a diagram of the new sequence.
  2. Create a new note.
  3. Write the following script in the note.
@startuml ASEQ_k_InitSeqTbl_Main
ASEQ_k_MainTask ->> CleanMotor : motor_off_cmd
ASEQ_k_MainTask ->> ValvePipeMotor : initialize_cmd
ASEQ_k_MainTask ->> TabletSlideRail: OpenPos_cmd
ASEQ_k_MainTask ->> PaperFeedMotor : initialize_cmd
ASEQ_k_MainTask ->> PressMotor : initialize_cmd
@enduml

The output of the script execution is shown below.

2022-10-12 18:15:3 [INFO]: ------VBScript Generate PlantUML script------
2022-10-12 18:15:3 [INFO]: Create Sequence PlantUML script activated
2022-10-12 18:15:3 [WARNING]: PlantUML Note element type not added to timeline array
Common.Sort-Array Error: Index is not in the valid range.: 'int(...)', line:58
gobravedave commented 1 year ago

thanks @Takashi-K-TakaTech The Generate PlantUML script macro generates PlantUML script into the selected note based on the EA sequence diagram. I have described the process here..

I have replicated the above error.. and it is because you do have any timelines..

This is what it generates with the diagram generated off the script you supplied above..

@startuml
autoactivate on
title sequence diagram  ASEQ_k_InitSeqTbl_Main
Participant ASEQ_k_MainTask #lightblue
Participant CleanMotor #lightblue
Participant ValvePipeMotor #lightblue
Participant TabletSlideRail #lightblue
Participant PaperFeedMotor #lightblue
Participant PressMotor #lightblue
ASEQ_k_MainTask ->> PaperFeedMotor: initialize_cmd()
ASEQ_k_MainTask ->> CleanMotor: motor_off_cmd()
ASEQ_k_MainTask ->> PressMotor: initialize_cmd()
ASEQ_k_MainTask ->> ValvePipeMotor: initialize_cmd()
ASEQ_k_MainTask ->> TabletSlideRail: OpenPos_cmd()
@enduml