Book a Demo

Author Topic: State Machine Simulation - Saving Login Data to Database  (Read 14092 times)

sude.ciloglu

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
State Machine Simulation - Saving Login Data to Database
« on: October 17, 2025, 07:44:52 pm »
Hello everyone,

I've created a state machine simulation in Sparx Enterprise Architect with a simple login screen (username and password).

My goal is to store the input data entered when the user clicks the Login button (this could be in an MS Access database, a text file, or even the EA's internal data store).

I've tried using VBScript (using ADODB.Connection for Access or FileSystemObject for writing a text file) within the Login Behavior of a state, but I get errors like unexpected token: identifier during the simulation, or the script doesn't run at all.

My question is:
Is there a recommended or supported way to store user input data (in Access, a text file, or the EA's internal storage) during a state machine simulation in EA?

Any advice or working examples would be very helpful.

Thanks in advance!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: State Machine Simulation - Saving Login Data to Database
« Reply #1 on: October 17, 2025, 10:00:47 pm »
I'm not sure state machine simulations are really the thing to use to write actual software.

But I'm even more concerned about your idea to store usernames and passwords.
That is a horrifically bad idea. :o

You should never ever store usernames and passwords in clear text.
And only if you really need to, store them using a proven secure method; and only if you really really know what you are doing.

In 99% of the cases, you should leave this to the professionals, and use some well know trusted third party software to authenticate your users.

Geert

Takeshi K

  • EA User
  • **
  • Posts: 630
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: State Machine Simulation - Saving Login Data to Database
« Reply #2 on: October 20, 2025, 10:58:23 am »
I guess the entered information is stored as simulation logs because there is no user input text information in the normal simulation log output.

If I were you, I would create a 'log' element (e.g. a UML Class or Object — an Artifact might be best) with a static name, and then add the information as tagged values of the log element. You can create an element and add tagged values via the automation interface in the simulation script.

Changing the log element name means backing up the log. Deleting the log element clears the log.

HTH,
--
t-kouno