P4Message-class {Proc4} | R Documentation |
"P4Message"
This is a message which is sent from one process to another in the four process architecture. There are certain header fields with are used to route the message and the details field which is an arbitrary list of data which will can be used by the receiver.
This class represents a semi-structured data object with certain
header fields which can be indexed plus the free-form details()
field which contains the body of the message. It can be serielized in
JSON format (using as.json
) or saved
in the Mongo database (using the mongolite
package).
Objects can be created by calls to the P4Message()
function.
Because all messages have a processed flag and a timestamp, a message
collection becomes a queue. Simply search for the message with the
earliest timestamp with processed(mess)==FALSE
and
excute that. Then sets processed equal to true using
markAsProcessed
.
If an error occurs during processing, the error can be associated with
the message by setting the pError field using
markAsError
.
_id
:Used for internal database ID.
app
:Object of class "character"
which
specifies the application in which the messages exit.
uid
:Object of class "character"
which
identifies the user (student).
context
:Object of class "character"
which
identifies the context, task, or item.
sender
:Object of class "character"
which
identifies the sender. This is usually one of
"Presentation Process", "Evidence Identification Process",
"Evidence Accumulation Process", or "Activity Selection Process".
mess
:Object of class "character"
a general
title for the message context.
timestamp
:Object of class "POSIXt"
which gives
the time at which the message was generated.
data
:Object of class "list"
which contains the
data to be transmitted with the message.
processed
:A logical value: true if the message has
been processed, and false if the message is still in queue to be
processed. This field is set with markAsProcessed
.
pError
:If a error occurs while processing this event,
information about the error can be stored here, either as an R
object, or as an R object of class error (or any class). This
field is accessed with processingError
and set with
markAsError
.
signature(x = "ANY")
: returns the _id
field, the database ID.
signature(x = "P4Message")
: returns the app field.
signature(obj = "P4Message", ml = "list")
:
coerces the object into a list to be processed by
toJSON
.
signature(x = "P4Message")
: Coerces the
message into a JSON string.
signature(x = "P4Message")
: returns the
context field.
signature(x = "P4Message")
: returns the data
associated with the message as a list.
signature(x = "P4Message")
: returns the message field.
signature(x = "P4Message")
: returns the sender
field.
signature(x = "P4Message")
: returns the timestamp.
signature(x = "P4Message")
: returns the user ID.
signature(x = "P4Message")
: returns a
logical value indicated whether or not the message has been marked
as processed.
signature(x = "P4Message")
: if an
error occurred while processing this message, returns a value
describing the error. Otherwise, returns NULL.
Russell G. Almond
Almond, R. G., Steinberg, L. S., and Mislevy, R.J. (2002). Enhancing the design and delivery of Assessment Systems: A Four-Process Architecture. Journal of Technology, Learning, and Assessment, 1, http://ejournals.bc.edu/ojs/index.php/jtla/article/view/1671.
P4Message()
— constructor
parseMessage
, saveRec
,
getOneRec
showClass("P4Message")