persist object is both an input and output of a BRAHMS Matlab Process. The object passed in is the same object as was passed out on the previous call; for the first call, the state of the persist object is as described below. Any changes the process makes to the object after this will be maintained into the next call. The only exception to this is that the framework may augment (but not otherwise modify) the
states field in response to OPERATION_GET_PROCESS_STATE.
The process may perform any modifications to the object whilst being called, and these modifications will be persisted to subsequent calls. Generally, the process should keep persist as empty as possible, since it takes time to pass stuff into and out of the function (simple processes may clear persist completely). For example, you might clear all of the constants you are not going to use whilst you are servicing EVENT_STATE_SET.
This section details the initial state of the persist object. It may be changed by the process at any time, and the
states field may be changed by the framework between calls in response to OPERATION_GET_PROCESS_STATE.
- Process information with (currently) one field,
name, the SystemML name of the process.
- A list of named constants, with names taken directly from their definitions in the Component Interface or in these bindings. Includes the event type constants, the event response constants, the event flags, operation codes defined by these bindings, and
- The SystemML document process <State> node, converted to a generic representation. You should parametrize your process using DataML to ensure that your state node can be translated correctly.
- One operation the process can perform, OPERATION_GET_PROCESS_STATE, gets the <State> node of a peer process. When this operation is performed, the state of the peer process is loaded into the
states field of the persist array between calls to the Matlab function. This is the only way that the bindings will modify the persist array between calls. Typically, the process will access this information immediately, but the framework does not clean it up. For optimal performance, the process should remove this from the persist array after use (using, e.g.,
persist.states = ).
- A template response structure, that the process may want to pass out in its output argument output. Without modification, this structure reponds "no response", "no error" and "no operations". Its use is shown in the example Matlab Function.
We reckon that if you don't parametrize using DataML, you'll get a generic XML representation; currently, it probably just falls over.