### Author Topic: Executable State Machine -Interpreted Simulation returns error ''not a function'  (Read 6732 times)

#### DaVos

• EA Novice
• Posts: 3
• Karma: +0/-0
##### Executable State Machine -Interpreted Simulation returns error ''not a function'
« on: November 08, 2021, 09:03:58 pm »
Hi everyone

I am trying to simulate an executable state machine that calls an operation. The operation returns a value and it is defined on a class.

As a first step I have used the EA example CD Player.

By running the simulation on interpreted mode I got the following error

\\sim.next is not a function.\\ The simulation is running on java.

The same error I got on my simulation.

I have followed all the guidelines described on EA dynamic simulation guidelines.

Did anyone faced the same problems with dynamic simulation ?

Regarding technicalities
1. How EA defines an operation on a class ?
for example if I define the following
this.a=a
this.b=b
return a+b

Is this enough or I have to define a method based on Java ? Define public or state keywords for the method definition etc

2. How I call this operation from a class ?
I have to define an object or just a simple call will do the job ? For example this.result=add(1,2)

Any help appreciated

#### philchudley

• EA User
• Posts: 687
• Karma: +17/-0
• UML/EA Principal Consultant / Trainer
##### Re: Executable State Machine -Interpreted Simulation returns error ''not a function'
« Reply #1 on: January 11, 2022, 12:53:29 am »
I have exactly the same problem I am using EA version 15.2.1560, although a colleague has said it all works fine in EA 15.1 which I haven't tried.

I even get the same error when trying to use the examples within EAExample

Some form of reply would be very nice and appreciated.

Phil

@SparxEAGuru

#### philchudley

• EA User
• Posts: 687
• Karma: +17/-0
• UML/EA Principal Consultant / Trainer
##### Re: Executable State Machine -Interpreted Simulation returns error ''not a function'
« Reply #2 on: January 11, 2022, 01:20:25 am »
Just a follow up, I get the same "not a function" error in EA v16 beta

Phil