question

Alessio Merlo avatar image
0 Likes"
Alessio Merlo asked Matthew Gillespie commented

destroymessageevents command

Hi community,

today I run into an issue with destroymessageevents command.

The sequence to reproduce it is simple.

1. I created a delayed message with the code

Object s = Model.find("Source1);

s.message(10,s,100);

2. I executed the code to remove the message from the event list

Object s = Model.find("Source1");
destroymessageevents(s,0,s);

After executing the script, nothing happens!

Can someone help me? I attached the model.

FlexSim 20.0.2
bug reportmessagesdestroymessageevent
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

This is a bug. The message() method isn't setting the event code of the event it creates. Thanks for pointing it out. We'll have this fixed for the next bug fix release.

The senddelayedmessage() command works fine if you need a workaround.

· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Alessio Merlo avatar image Alessio Merlo commented ·

I tried your solution, but it works partially.

If I don't use the any filter it works, but when I add some message parameter doesn't destroy the message. Could you check my attached model? Thanks!

destroymessageevents-workaround.fsm

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Alessio Merlo commented ·

I'm not sure why that's not working, I'll look into it some more.

1 Like 1 ·
Alessio Merlo avatar image Alessio Merlo Matthew Gillespie ♦♦ commented ·

I need to filter on message parameter, then if you fix the issue in the next release is perfect! Thanks for your support!

0 Likes 0 ·
Show more comments
tannerp avatar image tannerp Alessio Merlo commented ·

@Alessio Merlo,

Just leave out the message parameter and it destroys all of the messages:

25485-destroymessageevents-workaround-1.fsm

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ tannerp commented ·

Yes, but it looks like it's supposed to be filtering out which events it destroys based off the message parameters.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.