Rule: Interact-obtain-file-from-user
loading x elements...

Name: Interact-obtain-file-from-user

Version: 1

Discussion Thread

Creator: initial_tools

Hardcoded Priority (supersedes the rating): 4.5

This Rule has moderator approval.

React to a task_obtain_file_from_user and a require_a_file.

If the user already uploaded one or more files, the last of them is chosen.
Otherwise the user is asked to upload a file.

This Rule is really not a very good way of obtaining a file from a user. Feel free to upload a better way to do it.

ID: 78

Created: Sept. 27, 2018, 3:21 p.m.

full definition:

The below is the JSON description of this object.

It is annotated with links to the documentation of each component. Default values are written in grey.

Click to copy this text to your clipboard.

Rule

{ "name" : "Interact-obtain-file-from-user", "description" : "React to a task_obtain_file_from_user and a require_a_file.

If the user already uploaded one or more files, the last of them is chosen.
Otherwise the user is asked to upload a file.

This Rule is really not a very good way of obtaining a file from a user. Feel free to upload a better way to do it."
, "dependencies" : [

Dependency

{ "symbol" : "task_obtain_file_from_user", "weight" : 1.0, "comment_filter" : null }
], "threshold" : 1.0, "trigger" :

Trigger

{ "allow_repetition" : false, "arguments" : [

Tag filter (for search)

{ "type" : "tag", "var" : "theRequireTag", "role" : "required", "search_type" : "last", "search_postfilter" : null, "targeted_by" : [], "equals" : null, "created_by" : null, "created_earlier_than" : null, "created_in_same_event_as" : null, "created_later_than" : null, "symbol" : "require_a_file", "comment" : null, "comment_matches" : null, "weight" : null, "min_weight" : null, "max_weight" : null, "nullified" : false, "requirement_is_provided" : false, "task_is_finished" : null, "arguments" : { "0" :

Tag filter

{ "type" : "tag", "var" : "theTask", "role" : "required", "targeted_by" : [], "equals" : null, "created_by" : null, "created_earlier_than" : null, "created_in_same_event_as" : null, "created_later_than" : null, "symbol" : "task_obtain_file_from_user", "comment" : null, "comment_matches" : null, "weight" : null, "min_weight" : null, "max_weight" : null, "nullified" : false, "requirement_is_provided" : null, "task_is_finished" : false, "arguments" : {} }
} }
] }
, "actions" : [

Create a Message

{ "type" : "create_message", "var" : "theNewStatusMessage", "visibility" : "hidden", "message_components" : [

Text message component

{ "type" : "text", "text" : "Please upload a file!" }
] }
,

Create a Tag

{ "type" : "create_tag", "var" : "theTagForTheNewStatusMessage", "symbol" : "!set_idle_message", "comment" : null, "weight" : null, "arguments" : [

Variable

{ "type" : "variable", "nullable" : false, "var" : "theNewStatusMessage" }
] }
,

Create an Option

{ "type" : "create_option", "_comment" : "This Option finds any file uploaded by the user and marks it as the solution for a require_a_file Tag.", "var" : "interact-obtain-file-from-user", "name" : "interact-obtain-file-from-user", "description" : null, "confidence" : 100, "trigger" :

Trigger

{ "allow_repetition" : false, "arguments" : [

Tag filter (for search)

{ "type" : "tag", "var" : "weAreDoneHere", "role" : "optional", "search_type" : "last", "search_postfilter" : null, "targeted_by" : [], "equals" : "theRequireTag", "created_by" : null, "created_earlier_than" : null, "created_in_same_event_as" : null, "created_later_than" : null, "symbol" : null, "comment" : null, "comment_matches" : null, "weight" : null, "min_weight" : null, "max_weight" : null, "nullified" : false, "requirement_is_provided" : true, "task_is_finished" : null, "arguments" : {} }
,

File filter (for search)

{ "type" : "file", "var" : "theFile", "role" : "required", "search_type" : "last", "search_postfilter" : null, "targeted_by" : [

Tag filter (for search)

{ "type" : "tag", "var" : null, "role" : "required", "search_type" : "last", "search_postfilter" : null, "targeted_by" : [], "equals" : null, "created_by" : null, "created_earlier_than" : null, "created_in_same_event_as" : null, "created_later_than" : null, "symbol" : "?user_input_uploaded_file", "comment" : null, "comment_matches" : null, "weight" : null, "min_weight" : null, "max_weight" : null, "nullified" : false, "requirement_is_provided" : null, "task_is_finished" : null, "arguments" : {} }
], "equals" : null, "created_by" : null, "created_earlier_than" : null, "created_in_same_event_as" : null, "created_later_than" : null, "name_matches" : null }
] }
, "display" : null, "actions" : [

Conditionally execute actions

{ "type" : "conditional", "if" :

Reference exists Condition

{ "type" : "reference_exists", "exists" : "weAreDoneHere" }
, "then" : [], "else" : [

Create a Tag

{ "type" : "create_tag", "var" : null, "symbol" : "!nullify", "comment" : null, "weight" : null, "arguments" : [

Variable

{ "type" : "variable", "nullable" : false, "var" : "theTagForTheNewStatusMessage" }
] }
,

Create a Tag

{ "type" : "create_tag", "var" : null, "symbol" : "!provide", "comment" : null, "weight" : null, "arguments" : [

Variable

{ "type" : "variable", "nullable" : false, "var" : "theRequireTag" }
,

Variable

{ "type" : "variable", "nullable" : false, "var" : "theFile" }
] }
] }
,

Deactivate this Rule or Option

{ "type" : "deactivate_self", "var" : null }
] }
], "existing_variables" : { "theTask" :

Variable

{ "type" : "tag", "value" : null }
, "theRequireTag" :

Variable

{ "type" : "tag", "value" : null }
, "theNewStatusMessage" :

Variable

{ "type" : "message", "value" : null }
, "theTagForTheNewStatusMessage" :

Variable

{ "type" : "tag", "value" : null }
, "interact-obtain-file-from-user" :

Variable

{ "type" : "option", "value" : null }
} }

all versions of this Rule:

Version 1