Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - adeebulhafiz

Pages: [1]
1
Hi

Has anyone tried running a JScript or JavaScript in Pre-Processing and Post-Processing Script section in Interpreted Simulation of Analyzer Script.
AnalyzerScript>Simulation>Interpreted Simulation>Pre/Post-Processing Script.

here is the reference in the docs.
https://sparxsystems.com/enterprise_architect_user_guide/16.0/model_simulation/set_up_simulation.html#:~:text=For%20example%2C%20if%20you%20have%20a%20script%20named%20%27MyScript%27%20in%20the%20Script%20Group%20%27MyGroup%27%2C%20type%20in%20the%20value%20%27MyGroup.MyScript%27.

I am unable to run the script. Everything runs, but there is no sign that script ran really.
Here are my steps:
1. Created Myscript JavaScript withSimulation.Output("HW.."); in MyGroup.
2. Check the box for evaluation with JavaScript.
3. Added MyGroup.Myscript in the respective section.
4. Ran the script by right-click>Simulation>AnalyzerScript><scriptname>

Output:
Error in Simulation Console that MyGroup is not defined.

Best,
Adeeb

2
Hi Community

I am trying to generate and build the code for an executable state machine. The class should have a user defined enum variable, an array and a struct type variable. However the code generated is not correct and throws error on compilation.
How do I model this correctly in UML so that it compiles well?
I created a data type and enum separately and then added a composition link from class to these elements. Then I used enum and the data type in the Class as an Attribute. However during code build, I am thrown with bunch of errors basically meaning that these data types are not defined anywhere.

Note: I don't want a separate Classes for the each data type element. I want them to be included in the same file as .c or .cpp file depending on the language


Class Diagram:
https://ibb.co/C5g6DX2

Error and relevant code snippet generated:
https://ibb.co/sQGVWvk
https://ibb.co/tcFCDJD

C++ Error:
https://ibb.co/0y565fB

UML level: Beginner
EA version: 15.2

Thanks
Syed Adeebul Hafiz

3
Update:  I sent the issue to Sparx Support, they have confirmed this as a bug.

4
Automation Interface, Add-Ins and Tools / Read JSON file in JScript
« on: May 24, 2022, 12:12:27 am »
Hi Is there any way to read JSON file via JScript?
I am able to read a text file like this:
Code: [Select]
var fso, f1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.OpenTextFile("c:\\EA\\test.txt");
var ScriptName = f1.ReadLine();


However, I would like to take inputs from a JSON file. Is there any way to do it. Thanks!

EA version: 15.2 Unified Edition

5
General Board / Modeling of Interrupts and it's simulation.
« on: May 24, 2022, 12:02:48 am »
Hi,

I see that "Interruptible Regions" are excluded from fUML specification to create an executable model.

"InterruptibleRegion – Interruptible regions are excluded from fUML because they are considered to be more appropriate
for “higher level” process modeling and outside the scope of fUML.
"

reference: https://www.omg.org/spec/FUML/1.5/PDF

However according to this video we can do something similar from structured activity
https://www.youtube.com/watch?v=OXBdT9KI4dc

I want to do something similar in EA. But I am unable to do it. Any suggestion is appreciated.

Thanks,
Adeeb

6
Hi,

I am trying model a simple activity diagram that invokes another activity in it. Once the invoked activity is completed, I want to take a decision on the returned ActivityParameter Value from it, by adding a decision node just after activity diagram.

However, I see if I simulate this activity, at the decision node the control cannot evaluate anything and get stuck at that point. The moment I add an atomic action between the decision node and call behavior everything seems to work fine. So I am wondering if I am missing any detail about CallBehavior?
Note: Since both atomic action and CallBehavior are subclass of Base class BasicAction, it seems they both should work fine. then, this might be a bug in the EA.

Best,
Syed Adeebul Hafiz

7
I am trying to simulate a state machine. And a similar state machine exist in another project. Is there any way i can export the trigger sets in simulation events from one project or model to another.

Thanks.

My EA level: Beginner
EA version: 15.2 Unified Edition

8
General Board / Re: Create object in simulation
« on: April 14, 2022, 11:23:25 pm »
Okay This is strange. I had tried this earlier but it didn't work at that moment.
Just so that new beginner like me doesn't go through this.

I just dragged the classifier to the Activity Diagram, and voila everything works.  :)
But if EA support is watching this. It would be nice that they add it to the documentation.

However this in general doesn't seem right. If JS could create an Object, why do I have to create an Instance of the classifier by dragging it to the diagram. In this case what's the use of "CreateObject" function?

9
General Board / Create object in simulation
« on: April 14, 2022, 11:11:13 pm »
While following the Model simulation Tutorialhttps://sparxsystems.com/enterprise_architect_user_guide/15.2/model_simulation/create_objects_in_a_simulation.html#:~:text=Create%20Object%20Using%20JavaScript.
I am having issues.
The first thing is that I am unable to create an Object and use it's operation, everytime I reference it it says that "sim.ObjectName.operation is not a function". I am not sure exactly what am I doing wrong.
The classifier and action are in same package at same hierarchy level.
Steps I followed.
1. Create a classifier with two attributes x,y and one operation add.
2. Edit the behavior of add to:
Code: [Select]
this.x=x;
this.y=y;
return x+y;
3. Create an action in an Activity Diagram, and use effect field of the action to create object using JS as given in tutorial.
4. in the effect of next action element,
Code: [Select]
this.result = this.ObjectName.add(7,7);
5. Final element.
6. Run simulation with Action2 as breakpoint, to observe local window.

Once the code pauses and when Action2 gets executed in the next step. It throws error that "...add is not a function". I am not sure what I am doing wrong.

I have also initialized the attributes while defining them.
I have also tried initializing the attributes before passing anything to the "operation" in Action2.

I would appreciate the reply.

Edit:
My EA level: Beginner
EA version: 15.2 Unified Edition

Pages: [1]