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

Name: Interact-obtain-file-from-user

Version: 4

Discussion Thread

NOTE: this Rule has been deleted.

There is a newer version of this Rule.

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: 136

Created: Jan. 11, 2019, 3:41 p.m.

full definition:

The below is the JSON description of this object.

It is annotated with links to the documentation of each component.

You can hide fields with default values to make things clearer, and copy it to a clipboard to make creating similar Rules and Options easier.

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" }
], "threshold" : 1.0, "trigger" :

Trigger

{ "repeat" : "different_variables", "arguments" : [

Tag filter (for search)

{ "type" : "tag", "var" : "theRequireTag", "symbol" : "require_a_file", "requirement_is_provided" : false, "arguments" : { "0" :

Tag filter

{ "type" : "tag", "var" : "theTask", "symbol" : "task_obtain_file_from_user", "task_is_finished" : false }
} }
] }
, "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", "arguments" : [

Variable

{ "type" : "variable", "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", "confidence" : 100, "trigger" :

Trigger

{ "arguments" : [

File filter (for search)

{ "type" : "file", "var" : "theFile", "targeted_by" : [

Tag filter (for search)

{ "type" : "tag", "symbol" : "?user_input_uploaded_file" }
] }
], "deactivate_if" : { "theTask" : ["is_nullified", "is_finished"], "theRequireTag" : ["is_nullified", "is_provided"] } }
, "actions" : [

Create a Tag

{ "type" : "create_tag", "symbol" : "!provide", "arguments" : [

Variable

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

Variable

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

Create an Option

{ "type" : "create_option", "_comment" : "Nullify the !set_idle_message when the task is done.", "var" : "postprocess-interact-obtain-file-from-user", "name" : "postprocess-interact-obtain-file-from-user", "confidence" : 100, "trigger" :

Trigger

{ "arguments" : [

Tag filter (for search)

{ "type" : "tag", "equals" : "theTask", "task_is_finished" : true }
] }
, "actions" : [

Create a Tag

{ "type" : "create_tag", "symbol" : "!nullify", "arguments" : [

Variable

{ "type" : "variable", "var" : "theTagForTheNewStatusMessage" }
] }
] }
], "existing_variables" : { "theTask" :

Variable

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

Variable

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

Variable

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

Variable

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

Variable

{ "type" : "option" }
, "postprocess-interact-obtain-file-from-user" :

Variable

{ "type" : "option" }
} }

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

{ "repeat" : "different_variables", "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, "is_reserved" : null, "symbol" : "require_a_file", "comment" : null, "comment_contains" : 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, "is_reserved" : null, "symbol" : "task_obtain_file_from_user", "comment" : null, "comment_contains" : null, "comment_matches" : null, "weight" : null, "min_weight" : null, "max_weight" : null, "nullified" : false, "requirement_is_provided" : null, "task_is_finished" : false, "arguments" : {} }
} }
], "deactivate_if" : {} }
, "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" }
], "mark_with" : [] }
,

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

{ "repeat" : "never", "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, "is_reserved" : null, "symbol" : "?user_input_uploaded_file", "comment" : null, "comment_contains" : 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, "is_reserved" : null, "name_matches" : null }
], "deactivate_if" : { "theTask" : ["is_nullified", "is_finished"], "theRequireTag" : ["is_nullified", "is_provided"] } }
, "display" : null, "actions" : [

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" }
], "mark_with" : [] }
] }
,

Create an Option

{ "type" : "create_option", "_comment" : "Nullify the !set_idle_message when the task is done.", "var" : "postprocess-interact-obtain-file-from-user", "name" : "postprocess-interact-obtain-file-from-user", "description" : null, "confidence" : 100, "trigger" :

Trigger

{ "repeat" : "never", "arguments" : [

Tag filter (for search)

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

Create a Tag

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

Variable

{ "type" : "variable", "nullable" : false, "var" : "theTagForTheNewStatusMessage" }
], "mark_with" : [] }
] }
], "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 }
, "postprocess-interact-obtain-file-from-user" :

Variable

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

all versions of this Rule:

Version 8

Version 7 (deleted)

Version 6 (deleted)

Version 5 (deleted)

Version 4 (deleted)

Version 3 (deleted)

Version 2 (deleted)

Version 1 (deleted)