class T2Server::Interaction::Notification

This class represents a Taverna notification.



The identifier of this notification.


If this notification is a reply then this is the identifier of the notification that it is a reply to.


The serial number of a notification. This identifies a notification within a workflow.


The URI of the notification page to show.

Public Instance Methods

has_reply? → true or false click to toggle source

Does this notification have a reply? This only makes sense for notifications that are not replies or pure notifications.

# File lib/t2-server/interaction.rb, line 190
def has_reply?
input_data → data click to toggle source

Get the input data associated with this notification. Returns an empty string if this notification is a reply.

# File lib/t2-server/interaction.rb, line 199
def input_data
  return "" if is_reply?

  data_name = "interaction#{@id}InputData.json"
rescue AttributeNotFoundError
  # It does not matter if the file doesn't exist.
is_notification? → true or false click to toggle source

Is this notification a pure notification only? There is no user response to a pure notification, it is for information only.

# File lib/t2-server/interaction.rb, line 175
def is_notification?
is_reply? → true or false click to toggle source

Is this notification a reply to another notification?

# File lib/t2-server/interaction.rb, line 166
def is_reply?
reply(status, data) click to toggle source

Given a status and some data this method uploads the data and publishes an interaction reply on the run’s notification feed.

# File lib/t2-server/interaction.rb, line 214
def reply(status, data)
  data_name = "interaction#{@id}OutputData.json"

  notification = do |entry|
    entry.title = "A reply to #{@id}" = "#{@id}reply"
    entry.content = ""
    entry[FEED_NS, "run-id"] <<
    entry[FEED_NS, "in-reply-to"] << @id
    entry[FEED_NS, "result-status"] << status

  @run.write_interaction_data(data_name, data)