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 - MMA

Pages: [1] 2 3 ... 5
General Board / Re: Communication between concurrent states
« on: July 01, 2016, 02:38:39 pm »
You can use Executable Statemachine.

Create a class element MyClass, from Project Browser | Context menu | Add | Statemachine
  • Initial1, transition to State1, transition to Final1
  • Enlarge State1 | context menu | advanced | Define Concurrent Substates, create region1, region2
  • Inside region1: Initial2, transition to Stete2, transition(triggered by BBB) to State3, transition to Final2
  • Inside region2: Initial3, transition to Stete4, transition (triggered by AAA, Effect: %BROADCAST_EVENT("BBB")%) to Final3

Then create an Executable Statemachine artifact, enlarge it, Ctrl + Drag MyClass and drop as a Property, name it Part1.
Set the artifact's language, JavaScript (you can also set to Java, C++, C#, C if you have a compiler).

Context menu on Artifact | Code Engineering | Executable Statemachine | Generate, Build and Run | Specify a path for the source code | Generate

The simulation will start and State2 and State4 are the two active states in the concurrent regions. Open Simulate Events (Trigger) window, double click "AAA", which will trigger event "AAA" and transition from State4 to Final3 takes effect, during which, an event "BBB" will be broadcasted and cause State2 exit and transition to State3. The full trace are available in the Debug window.

[21383023]      Part1[MyClass].Initial1_280__TO__State1_127 Effect
[21383024]      Part1[MyClass].StateMachine_State1 ENTRY
[21383025]      Part1[MyClass].StateMachine_State1 DO
[21383026]      Part1[MyClass].Initial3_285__TO__State4_130 Effect
[21383027]      Part1[MyClass].StateMachine_State1_State4 ENTRY
[21383028]      Part1[MyClass].StateMachine_State1_State4 DO
[21383029]      Part1[MyClass].Initial2_282__TO__State2_128 Effect
[21383030]      Part1[MyClass].StateMachine_State1_State2 ENTRY
[21383030]      Part1[MyClass].StateMachine_State1_State2 DO
[21384117]      Blocked
[21386083]      Part1[MyClass].StateMachine_State1_State4 EXIT
[21386085]      Part1[MyClass].State4__TO__Final3_287_131 Effect
[21386640]      Part1[MyClass].StateMachine_State1_State2 EXIT
[21386647]      Part1[MyClass].State2__TO__State3_129 Effect
[21386649]      Part1[MyClass].StateMachine_State1_State3 ENTRY
[21386650]      Part1[MyClass].StateMachine_State1_State3 DO
[21387185]      Part1[MyClass].StateMachine_State1_State3 EXIT
[21387192]      Part1[MyClass].State3__TO__Final2_284_133 Effect
[21387700]      Part1[MyClass].StateMachine_State1 EXIT
[21387707]      Part1[MyClass].State1__TO__Final1_288_132 Effect

The key point is the effect expression:

If you want to send the event to a specific context (E.g. Your artifact has 2 contexts, Part1, Par2; you want to send a event to Part2 from a transition in Part1), you can use:
%SEND_EVENT("EventName", CONTEXT_REF(context instance name))%


General Board / Re: BPSim and intermediate event
« on: February 20, 2016, 09:00:27 pm »
Hi Maros,

Your Intermediate Event is not a Boundary Event. Fix it by:

Ctrl + Del your Intermediate Event | From the tool box, click Intermediate Event and drop on Activity1 | from the popup menu "stand-alone/Edge-mounted", select "Edge-mounted".

Then double click the Intermediate Event | choose "Bound-Interrupting | Error"

Note: make sure the Activity1 is a sub-process


General Board / Re: BPMN Simulationin Ultimate edition vs BPSim
« on: February 19, 2016, 05:08:14 pm »
Not too sure.

The EA built in BPMN simulation is like "Activity diagram simulation". You can not setup parameter on each task.

the BPSim configuration and MDG BPSim Execution Engine is much more flexible and powerful.

General Board / Re: BPSim and intermediate event
« on: February 19, 2016, 10:55:41 am »
In your example, there should be a subprocess that could ended with an Error Event.

Then the Boundary Interrupting Error Intermediate Event can response to it.

This examples shows that 24 tokens out of 100 ended by Error and 76 ended normally. (We had a setting of 0.2 and 0.8 probability on the sequences flows outgoing from the gateway respectively.)

Another simpler example is the Timer Intermediate Boundary event (for 1 hour) on a userTask, whose ProcessingTime could range from 0 to 1000 with mean of 50 minutes.

Hope that helps  ;D


General Board / Re: BPSim run scenario problem
« on: February 18, 2016, 08:59:00 am »
Hi Maros,

According to your requirement, following tips might be helpful:

1. Calendar: you should create 2 calendars PEAK_HOUR, OFFPEAK_HOUR.
2. Then you setup the "Control | InterTriggerTimer" parameter for the start event:
    3 minutes, calendar choose to PEAK_HOUR
    20 minutes, calendar choose to OFFPEAK_HOUR
    some dummy like 99 minutes, calendar choose to empty "----"   (It is a must to set the default non-calendar item, otherwise it won't work.  If this is not set and you click "Validate", this important error will be picked up by validator and report in the System Output window)

3. Set the "Control | TriggerCount" to be 4000
4. Make sure the "Duration" parameter is big enough, e.g. 9999 000:00:00

Note: If the Duration is too short while TriggerCount is set to large number, the simulation will terminate early because of "timeout".

If you want some further realistic randomness, you can use distribution type of parameter for the InterTriggerTimer (the calendars could remain the same setting as above).

Note: The time unit on distribution page is not supported at the moment, Data is ignored and the basetimeUnit specified in the scenario is used.

Have a look at this webinar, in which a "Poisson distribution" is used to initialize the "numberOfIssues" property.  (you may use many other type of distributions).

Simulation and Decision Making in Enterprise Architect 12.1

Hope that helps

I tried your template and generated

Code: [Select]
if(lines[i].indexof(' ')>0){//do something}

Although the following trick works, Aaron's Answer is much better.

if(lines.indexof('%TO_LOWER("\T")%')>0){//do something}

Then it will generate
Code: [Select]
if(lines[i].indexof('\t')>0){//do something}

General Board / Re: BPSim: total time on subprocess
« on: February 16, 2016, 11:55:01 am »
I believe two steps will fix your issue:

    1. Double click the activity which you intended to model as sub-process, in the type combobox, select subProcess, OK to save it. (It was "abstract task" by default and you didn't set time parameter on it, that's why you got 0 for this "subProcess")

    2. Make sure the subProcess is valid. E.g. one simple valid process contains a start event, a Task, an end event.

I've just ran this case and it works:

enlarge SubProcess1 and put following elements in it:

Then Configure BPSim Time parameters(ProcessingTime for example) on Task1 (10 minutes), Task2(2 minutes), Task3(3 Minutes);
The result:
Average Time on Task1: 10 Minutes
Average Time on Task2: 2 Minutes
Average Time on Task3: 3 Minutes
Average Time on SubProcess1: 5 Minutes (it is the summary of Task2 and Task3)

Hope that helps  ;D

General Board / Re: State Machine Code Generation
« on: December 09, 2015, 09:25:46 am »
Ok. Thanks. I got it running with the signal event arguments. However in the guard condition I have to access the signal like that: ((MySignal)_event.signal).Arg1==2
Is this the proper way?

You are correct.

At least you need the word "MySignal" and "Arg1" to appear in the expression; then the actual expression didn't add too much on the basic ;)

General Board / Re: State Machine Code Generation
« on: December 04, 2015, 08:47:59 am »
1. The Statemachine defined in UML Specification is complicated. Rather than focus on "toy" examples (e.g. simple state); EA produced code fully conform to the Spec and it is executable.

The simulation is actually a visual debug (step) of the code running at the behind.

If you likes to read the code, it would be easier if you have a full trace the debug process.

2. Create Signal Event; then the attributes of the signal can be used as parameters of trigger. E.g. you can use them in transition guard, change the run-time value of these attributes in the transition's behavior.

3. More details?

Hope that helps

General Board / Re: Synchronize model with ERWIN
« on: December 14, 2015, 02:40:42 pm »
If the model is maintained by Enterprise Architect, then the "Database Compare" can pickup the difference from the DBMS and your model and then give you the options like:
  • (right==>left)use DBMS schema to update your model;
  • (left==>right)use you model to update DBMS schema via generation of Create/Alter DDLs and run in the execution engine in an executable order without losing any data.
If you don't need the model in ERWIN, you could use EA to import from ODBC that is configured to your existing database. Otherwise, here is my suggestion to migrate the existing model in ERWIN to EA via a temp-empty-bridging database:

Now you have:
    A. model in ERWIN
    B. the existing database with data

1. Create a new database "C", same type as "B"
2. use ERWIN's model "A" to create schema in the database "C".
3. use EA to import from "C" (Import DB Schema from ODBC), then you will get model in EA "D".

Now you have:
    C. the "bridging database"
    D. model in EA

"D" is exactly the same as "A", then you can use EA's "Compare Database" to compare "D" and "B", apply actions... (left=>right or right=>left)

You can discard the bridging database "C" afterwards.

Note: the process from "A" to "D" via bridging "C" is a once-off operation.

Hope that helps

General Board / Re: Code Generation for State Machine ACTIONs
« on: December 09, 2015, 09:37:38 am »
How would you know such details?
As a Sparx employee that should be mandatory, I guess.


You are correct.

Besides, we are making the help system on this area more thorough... ;)

General Board / Re: Code Generation for State Machine ACTIONs
« on: December 03, 2015, 11:23:49 am »
There is a Behavior tab, on which there are two things:
#1. Behavior text field; For example, you input "Hello"
#2. The Initial Code button, e.g. you input "World"
The generated code will be:

This is specified @ Package | Code Engineering | Code Generation Templates | STM_Java_Structured | Stm State Proc

Search following string:
public boolean %stmStateFQName%_behavior(StateBehaviorEnum behavior)
in which function $entry_behavior is corresponding to #1 and $entry_code is corresponding to #2
Then you can edit the template to suit your needs.

Note: specify the behavior to another behavior element (e.g. Activity, Statemachine, Operation, Interation) is not supported by executable simulation at the moment. The workaround is to type the function call's name and arguments(if any) in the field. e.g. foo(bar);

General Board / Re: cannot change the involved columns of a constr
« on: December 03, 2015, 11:34:30 am »
I've tried completely deleting the association between the two entities ...

There are two kinds of delete:

shallow delete: simply delete the link on the diagram; the relationship is still there. You can bring it back by: Property on the element | Links | select the relationship in the list | context menu | Show Relation

deep delete: the relationship is deleted. (Ctrl + Delete)

Try the deep delete; otherwise contact the support

General Board / Re: Export DDL to different DBMS?
« on: November 24, 2015, 09:09:06 am »
There are two processes:
1. Import: connect to the database from EA and import the schemas
Then EA will have a model, you can change this model's database to another DBMS.
2. Export: Export this model as .SQL or Execute the generated sql to create tables/indexes/procedures....

However, I'm not quite sure whether "Pervasive" is supported or not.

General Board / Re: State Machine Code Generation
« on: November 20, 2015, 09:00:49 am »
I believe you generated this file from the class element.

go through these steps and you will have a bunch of files which can pass compile and you can execute/simulate.

Hope that helps  ;)

Pages: [1] 2 3 ... 5