MCPServer/TaskTypes

From Archivematica
< MCPServer(Difference between revisions)
Jump to: navigation, search
(Added in progeress task type notes)
Line 1: Line 1:
 +
For each '''MicroServiceChainLink''' in the [[MCP | MCP Server ]], the TaskType determines what code will be executed for that task.  There are 13 task types.
  
* [[MCP/TaskTypes/one_instance]]
+
Reading about the [[MCP | MCP Server ]] is highly recommended to understand this page.
* [[MCP/TaskTypes/for_each_file]]
+
 
* [[MCP/TaskTypes/magic_links]]
+
== General ==
* [[MCP/TaskTypes/unit_variables]]
+
=== Run once ===
* [[MCP/TaskTypes/processing_choices]]
+
* '''UUID''': 36b2e239-4a57-4aa5-8ebc-7a29139baca6
* [[MCP/TaskTypes/Normalization]]
+
* '''Description in TaskTypes''': one instance
 +
* '''LinkTaskMananger''': linkTaskManagerDirectories
 +
* '''TaskTypePKReference''': FK to '''StandardTasksConfigs'''
 +
Run the command listed in StandardTasksConfigs exactly once.  TODO filterSubDir?  [[MCP/TaskTypes/one_instance | Old Notes]]
 +
 
 +
=== Run for each file ===
 +
* '''UUID''': a6b1c323-7d36-428e-846a-e7e819423577
 +
* '''Description in TaskTypes''': for each file
 +
* '''LinkTaskMananger''': linkTaskManagerFiles
 +
* '''TaskTypePKReference''': FK to '''StandardTasksConfigs'''
 +
Run the command once for each file associated with that Unit (SIP, DIP, Transfer).  Files can be filtered using filterFileEnd, filterFileStart (works on the basename of the file) or filterSubDir (selects only files in those directories)  [[MCP/TaskTypes/for_each_file | Old Notes]]
 +
 
 +
== User Choice ==
 +
[[MCP/TaskTypes/processing_choices | Old Notes]]
 +
=== Get User Choice - select chain ===
 +
* '''UUID''': 61fb3874-8ef6-49d3-8a2d-3cb66e86a30c
 +
* '''Description in TaskTypes''': get user choice to proceed with
 +
* '''LinkTaskMananger''': linkTaskManagerChoice
 +
* '''TaskTypePKReference''': FK to '''MicroServiceChainChoice'''
 +
* '''Use Case''': Run different MicroServiceChains based on user input
 +
Run a MicroServiceChain, depending on what the user chooses.  Each MicroServiceChainChoice knows where it should be displayed (choiceAvailableAtLink), and what chain to run if it is selected (chainAvailable).  The text to display comes from MicroServiceChains.description, as does the MicroServiceChainLink to run (MicroServiceChains.startingLink)
 +
 
 +
=== Get User Choice - select replacement dict ===
 +
* '''UUID''': 9c84b047-9a6d-463f-9836-eafa49743b84
 +
* '''Description in TaskTypes''': get replacement dic from user choice
 +
* '''LinkTaskMananger''': linkTaskManagerReplacementDicFromChoice
 +
* '''TaskTypePKReference''': FK to '''MicroServiceChoiceReplacementDic'''
 +
* '''Use Case''': Run the same MicroServiceChainLinks in all cases, but with slightly different behavior based on user input, and you know all the options ahead of time.  Adds the user choice as a replacement variable.
 +
Adds a new replacement dict and value for the rest of the chain.  Future commands can use replacement %FOO% in their StandardTaskConfigs.arguments, and it will be replaced by the user's choice.  Each MicroServiceChoiceReplacementDic knows where it should be displayed (choiceAvailableAtLink), what text to display (description) and what replacement variables to add (replacementDic).
 +
 
 +
'''WARNING''': The replacement variables will disappear when a new MicroServiceChain is started, because the Unit is recreated.
 +
 
 +
=== Generate User Choice in MicroService ===
 +
* '''UUID''': a19bfd9f-9989-4648-9351-013a10b382ed
 +
* '''Description in TaskTypes''': Get microservice generated list in stdOut
 +
* '''LinkTaskMananger''': linkTaskManagerGetMicroserviceGeneratedListInStdOut
 +
* '''TaskTypePKReference''': FK to '''StandardTasksConfigs'''
 +
* '''Use Case''': Run the same MicroServiceChainLinks in all cases, but with slightly different behavior based on user input, and you need to get the options at run time.  Requires [[#Get User Choice - select from MicroService Generated List]]
 +
Takes the output (stdout) of the command run, evaluates it into a single python object, and adds it to the chain's passVar as a choicesDic.  The output is almost always a dict of {'choice to display':'value for replacement dict'}.
 +
 
 +
=== Get User Choice - select from MicroService Generated List ===
 +
* '''UUID''': 01b748fe-2e9d-44e4-ae5d-113f74c9a0ba
 +
* '''Description in TaskTypes''': Get user choice from microservice generated list
 +
* '''LinkTaskMananger''': linkTaskManagerGetUserChoiceFromMicroserviceGeneratedList
 +
* '''TaskTypePKReference''': FK to '''StandardTasksConfigs'''
 +
* '''Use Case''': Run the same MicroServiceChainLinks in all cases, but with slightly different behavior based on user input, and you need to get the options at run time.  Adds the user choice as a replacement variable.  Requires [[#Get User Choice - select from MicroService Generated List]]
 +
Looks for a choicesDic in the passVar, and displays the choices to the user.  Values to display are the choicesDic keys, and the choicesDic value is put in a replacement variable specified in StandardTasksConfig.execute.
 +
 
 +
'''WARNING''': The replacement variables will disappear when a new MicroServiceChain is started, because the Unit is recreated.
 +
 
 +
== Unit Variable? ==
 +
[[MCP/TaskTypes/unit_variables | Old Notes]]
 +
=== Set Unit Variable ===
 +
* '''UUID''': 6f0b612c-867f-4dfd-8e43-5b35b7f882d7
 +
* '''Description in TaskTypes''': linkTaskManagerSetUnitVariable
 +
* '''LinkTaskMananger''': linkTaskManagerSetUnitVariable
 +
* '''TaskTypePKReference''': FK to '''TasksConfigsSetUnitVariable'''
 +
 
 +
=== Get Unit Variable ===
 +
* '''UUID''': c42184a3-1a7f-4c4d-b380-15d8d97fdd11
 +
* '''Description in TaskTypes''': linkTaskManagerUnitVariableLinkPull
 +
* '''LinkTaskMananger''': linkTaskManagerUnitVariableLinkPull
 +
* '''TaskTypePKReference''': FK to '''TasksConfigsUnitVariableLinkPull'''
 +
 
 +
== Transcoding ==
 +
[[MCP/TaskTypes/Normalization | Old Notes]]
 +
=== Split based on File? ===
 +
* '''UUID''': 75cf8446-1cb0-474c-8245-75850d328e91
 +
* '''Description in TaskTypes''': Split creating Jobs for each file
 +
* '''LinkTaskMananger''': linkTaskManagerSplit
 +
* '''TaskTypePKReference''': FK to '''TasksConfigsStartLinkForEachFile'''
 +
 
 +
=== Split based on File and Ruleset? ===
 +
* '''UUID''': 405b061b-361e-4e75-be27-834a1bc25f5c
 +
* '''Description in TaskTypes''': Split Job into many links based on file ID
 +
* '''LinkTaskMananger''': linkTaskManagerSplitOnFileIdAndruleset
 +
* '''TaskTypePKReference''': FK to '''StandardTasksConfigs'''
 +
 
 +
=== Transcode ===
 +
* '''UUID''': 5e70152a-9c5b-4c17-b823-c9298c546eeb
 +
* '''Description in TaskTypes''': Transcoder task type
 +
* '''LinkTaskMananger''': linkTaskManagerTranscoderCommand
 +
* '''TaskTypePKReference''': FK to '''CommandRelationships'''
 +
 
 +
== Magic Links - Deprecated ==
 +
Replaced by Unit Variables.  [[MCP/TaskTypes/magic_links | Old Notes]]
 +
=== Set Magic Link - Deprecated ===
 +
* '''UUID''': 3590f73d-5eb0-44a0-91a6-5b2db6655889
 +
* '''Description in TaskTypes''': assign magic link
 +
* '''LinkTaskMananger''': linkTaskManagerAssignMagicLink
 +
* '''TaskTypePKReference''': FK to '''TasksConfigsAssignMagicLink'''
 +
 
 +
=== Get Magic Link - Deprecated ===
 +
* '''UUID''': 6fe259c2-459d-4d4b-81a4-1b9daf7ee2e9
 +
* '''Description in TaskTypes''': goto magic link
 +
* '''LinkTaskMananger''': linkTaskManagerLoadMagicLink
 +
* '''TaskTypePKReference''': NULL
 +
 
 +
 
 +
 
 +
[[Category:Development documentation]]

Revision as of 16:17, 12 September 2013

For each MicroServiceChainLink in the MCP Server , the TaskType determines what code will be executed for that task. There are 13 task types.

Reading about the MCP Server is highly recommended to understand this page.

Contents

General

Run once

  • UUID: 36b2e239-4a57-4aa5-8ebc-7a29139baca6
  • Description in TaskTypes: one instance
  • LinkTaskMananger: linkTaskManagerDirectories
  • TaskTypePKReference: FK to StandardTasksConfigs

Run the command listed in StandardTasksConfigs exactly once. TODO filterSubDir? Old Notes

Run for each file

  • UUID: a6b1c323-7d36-428e-846a-e7e819423577
  • Description in TaskTypes: for each file
  • LinkTaskMananger: linkTaskManagerFiles
  • TaskTypePKReference: FK to StandardTasksConfigs

Run the command once for each file associated with that Unit (SIP, DIP, Transfer). Files can be filtered using filterFileEnd, filterFileStart (works on the basename of the file) or filterSubDir (selects only files in those directories) Old Notes

User Choice

Old Notes

Get User Choice - select chain

  • UUID: 61fb3874-8ef6-49d3-8a2d-3cb66e86a30c
  • Description in TaskTypes: get user choice to proceed with
  • LinkTaskMananger: linkTaskManagerChoice
  • TaskTypePKReference: FK to MicroServiceChainChoice
  • Use Case: Run different MicroServiceChains based on user input

Run a MicroServiceChain, depending on what the user chooses. Each MicroServiceChainChoice knows where it should be displayed (choiceAvailableAtLink), and what chain to run if it is selected (chainAvailable). The text to display comes from MicroServiceChains.description, as does the MicroServiceChainLink to run (MicroServiceChains.startingLink)

Get User Choice - select replacement dict

  • UUID: 9c84b047-9a6d-463f-9836-eafa49743b84
  • Description in TaskTypes: get replacement dic from user choice
  • LinkTaskMananger: linkTaskManagerReplacementDicFromChoice
  • TaskTypePKReference: FK to MicroServiceChoiceReplacementDic
  • Use Case: Run the same MicroServiceChainLinks in all cases, but with slightly different behavior based on user input, and you know all the options ahead of time. Adds the user choice as a replacement variable.

Adds a new replacement dict and value for the rest of the chain. Future commands can use replacement %FOO% in their StandardTaskConfigs.arguments, and it will be replaced by the user's choice. Each MicroServiceChoiceReplacementDic knows where it should be displayed (choiceAvailableAtLink), what text to display (description) and what replacement variables to add (replacementDic).

WARNING: The replacement variables will disappear when a new MicroServiceChain is started, because the Unit is recreated.

Generate User Choice in MicroService

  • UUID: a19bfd9f-9989-4648-9351-013a10b382ed
  • Description in TaskTypes: Get microservice generated list in stdOut
  • LinkTaskMananger: linkTaskManagerGetMicroserviceGeneratedListInStdOut
  • TaskTypePKReference: FK to StandardTasksConfigs
  • Use Case: Run the same MicroServiceChainLinks in all cases, but with slightly different behavior based on user input, and you need to get the options at run time. Requires #Get User Choice - select from MicroService Generated List

Takes the output (stdout) of the command run, evaluates it into a single python object, and adds it to the chain's passVar as a choicesDic. The output is almost always a dict of {'choice to display':'value for replacement dict'}.

Get User Choice - select from MicroService Generated List

  • UUID: 01b748fe-2e9d-44e4-ae5d-113f74c9a0ba
  • Description in TaskTypes: Get user choice from microservice generated list
  • LinkTaskMananger: linkTaskManagerGetUserChoiceFromMicroserviceGeneratedList
  • TaskTypePKReference: FK to StandardTasksConfigs
  • Use Case: Run the same MicroServiceChainLinks in all cases, but with slightly different behavior based on user input, and you need to get the options at run time. Adds the user choice as a replacement variable. Requires #Get User Choice - select from MicroService Generated List

Looks for a choicesDic in the passVar, and displays the choices to the user. Values to display are the choicesDic keys, and the choicesDic value is put in a replacement variable specified in StandardTasksConfig.execute.

WARNING: The replacement variables will disappear when a new MicroServiceChain is started, because the Unit is recreated.

Unit Variable?

Old Notes

Set Unit Variable

  • UUID: 6f0b612c-867f-4dfd-8e43-5b35b7f882d7
  • Description in TaskTypes: linkTaskManagerSetUnitVariable
  • LinkTaskMananger: linkTaskManagerSetUnitVariable
  • TaskTypePKReference: FK to TasksConfigsSetUnitVariable

Get Unit Variable

  • UUID: c42184a3-1a7f-4c4d-b380-15d8d97fdd11
  • Description in TaskTypes: linkTaskManagerUnitVariableLinkPull
  • LinkTaskMananger: linkTaskManagerUnitVariableLinkPull
  • TaskTypePKReference: FK to TasksConfigsUnitVariableLinkPull

Transcoding

Old Notes

Split based on File?

  • UUID: 75cf8446-1cb0-474c-8245-75850d328e91
  • Description in TaskTypes: Split creating Jobs for each file
  • LinkTaskMananger: linkTaskManagerSplit
  • TaskTypePKReference: FK to TasksConfigsStartLinkForEachFile

Split based on File and Ruleset?

  • UUID: 405b061b-361e-4e75-be27-834a1bc25f5c
  • Description in TaskTypes: Split Job into many links based on file ID
  • LinkTaskMananger: linkTaskManagerSplitOnFileIdAndruleset
  • TaskTypePKReference: FK to StandardTasksConfigs

Transcode

  • UUID: 5e70152a-9c5b-4c17-b823-c9298c546eeb
  • Description in TaskTypes: Transcoder task type
  • LinkTaskMananger: linkTaskManagerTranscoderCommand
  • TaskTypePKReference: FK to CommandRelationships

Magic Links - Deprecated

Replaced by Unit Variables. Old Notes

Set Magic Link - Deprecated

  • UUID: 3590f73d-5eb0-44a0-91a6-5b2db6655889
  • Description in TaskTypes: assign magic link
  • LinkTaskMananger: linkTaskManagerAssignMagicLink
  • TaskTypePKReference: FK to TasksConfigsAssignMagicLink

Get Magic Link - Deprecated

  • UUID: 6fe259c2-459d-4d4b-81a4-1b9daf7ee2e9
  • Description in TaskTypes: goto magic link
  • LinkTaskMananger: linkTaskManagerLoadMagicLink
  • TaskTypePKReference: NULL
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox