In the previous chapters (Step 6 and Step 7) we saw how Murmex calls the specific methods depending on the command in the Message. For example, it calls the Initialise method ( when a InitialiseMessage is received and the Terminate method when the TerminateMessage is received. Even when you do not implement the method in your class, the Murmex method is called anyway. The list of implemented methods and related messages is as following:

Table 1. List of Murmex commands

Command Called method Message class Response description
null Handle time-out Message responds when no message has been received for the timeout response time
acknowledge Acknowledge AcknowledgeMessage responds with confirmation of reception
configure Configure ConfigureMessage configures the connection, observers and mapping script
fetch Fetch FetchMessage receives data from observees
generic Generic command handler GenericMessage can call non-predefined states
inform Inform InformMessage providing the latest instance data of the class
initialise Initialise InitialiseMessage initialisation 1
inspect Inspect InspectMessage asking to get the latest instance data of the class
proceed Proceed ProceedMessage indicate to observee that current class is ready to proceed
reset Reset ResetMessage resets the internal state
start Start StartMessage start functionality
stop Stop StopMessage stop functionality
terminate Terminate TerminateMessage closes connection and ends program 2
update Update UpdateMessage receive new values
1 required method to be called first 2 called upon error

As can be seen, the list is limited to these 14 commands and methods, but can be extended by using the generic command. Inside a GenericMessage you can specify your own command name. In the method Generic command handler you create a case structure to execute the code depending on your own defined commands.

Generic command handler
  1. If not existing in your project, add the virtual folder “action methods”.
  2. Add to the action methods folder the method Generic command handler. Use the Right-mouse click menu >> New >> VI for Override… Override parent method
  3. Add a case structure and wire the output of the parent method. Generic command case structure
  4. Implement the structures for your specified commands. Generic command dialog message
  5. Send the message from somewhere, for example send the dialog message from the Main to yourself. Use the method ‘Set generic command’ from the GenericMessage class and add the parameter ‘dialog_message’ by the method ‘Add or replace parameter’ from the Message class. As we want to send it exclusively to ourselves, use the method ‘Send message internally’. Generic command create message
  6. Resulting that if we change the text to ‘Hello World!’ we execute the dialog as following. Generic command result
  7. Of course one can extend the Generic command handler to become the classic finite state machine. Extended state machine