Difference between revisions of "MCPServer/TaskTypes"
(Mark Transcoding as removed.) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Main Page]] > [[Development]] > [[:Category:Development documentation|Development documentation]] > [[ | + | [[Main Page]] > [[Development]] > [[:Category:Development documentation|Development documentation]] > [[MCPServer]] > TaskTypes |
+ | |||
+ | <div style="padding: 10px 10px; border: 1px solid black; background-color: #F79086;">This page is no longer being maintained and may contain inaccurate information. Please see the [https://www.archivematica.org/docs/latest/ Archivematica documentation] for up-to-date information. </div> <p> | ||
<div class="status"> | <div class="status"> | ||
Line 20: | Line 22: | ||
</div> | </div> | ||
− | For each '''MicroServiceChainLink''' in the [[ | + | For each '''MicroServiceChainLink''' in the [[MCPServer | MCP Server ]], the TaskType determines what code will be executed for that task. There are 13 task types. |
− | Reading about the [[ | + | Reading about the [[MCPServer | MCP Server]] is highly recommended to understand this page. |
== General == | == General == | ||
Line 29: | Line 31: | ||
* '''Description in TaskTypes''': one instance | * '''Description in TaskTypes''': one instance | ||
* '''LinkTaskMananger''': linkTaskManagerDirectories | * '''LinkTaskMananger''': linkTaskManagerDirectories | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#StandardTasksConfigs | StandardTasksConfigs]] |
− | Run the command listed in StandardTasksConfigs exactly once. TODO filterSubDir? | + | Run the command listed in StandardTasksConfigs exactly once. TODO filterSubDir? |
=== Run for each file === | === Run for each file === | ||
Line 36: | Line 38: | ||
* '''Description in TaskTypes''': for each file | * '''Description in TaskTypes''': for each file | ||
* '''LinkTaskMananger''': linkTaskManagerFiles | * '''LinkTaskMananger''': linkTaskManagerFiles | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#StandardTasksConfigs | 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) | + | 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) |
== User Choice == | == User Choice == | ||
Line 45: | Line 47: | ||
* '''Description in TaskTypes''': get user choice to proceed with | * '''Description in TaskTypes''': get user choice to proceed with | ||
* '''LinkTaskMananger''': linkTaskManagerChoice | * '''LinkTaskMananger''': linkTaskManagerChoice | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#MicroServiceChainChoice | MicroServiceChainChoice]] |
* '''Use Case''': Run different MicroServiceChains based on user input | * '''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) | 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) | ||
Line 53: | Line 55: | ||
* '''Description in TaskTypes''': get replacement dic from user choice | * '''Description in TaskTypes''': get replacement dic from user choice | ||
* '''LinkTaskMananger''': linkTaskManagerReplacementDicFromChoice | * '''LinkTaskMananger''': linkTaskManagerReplacementDicFromChoice | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#MicroServiceChoiceReplacementDic | 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. | * '''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). | 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). | ||
Line 63: | Line 65: | ||
* '''Description in TaskTypes''': Get microservice generated list in stdOut | * '''Description in TaskTypes''': Get microservice generated list in stdOut | ||
* '''LinkTaskMananger''': linkTaskManagerGetMicroserviceGeneratedListInStdOut | * '''LinkTaskMananger''': linkTaskManagerGetMicroserviceGeneratedListInStdOut | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#StandardTasksConfigs | 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]] | * '''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'}. | 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'}. | ||
Line 71: | Line 73: | ||
* '''Description in TaskTypes''': Get user choice from microservice generated list | * '''Description in TaskTypes''': Get user choice from microservice generated list | ||
* '''LinkTaskMananger''': linkTaskManagerGetUserChoiceFromMicroserviceGeneratedList | * '''LinkTaskMananger''': linkTaskManagerGetUserChoiceFromMicroserviceGeneratedList | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#StandardTasksConfigs | 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]] | * '''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. | 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. | ||
Line 83: | Line 85: | ||
* '''Description in TaskTypes''': linkTaskManagerSetUnitVariable | * '''Description in TaskTypes''': linkTaskManagerSetUnitVariable | ||
* '''LinkTaskMananger''': linkTaskManagerSetUnitVariable | * '''LinkTaskMananger''': linkTaskManagerSetUnitVariable | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#TasksConfigsSetUnitVariable | TasksConfigsSetUnitVariable]] |
For SIPs and Transfers only. Inserts an entry into '''UnitVariables''' with a foreign key back to the SIP or Transfer, and values 'variable', 'variableValue' and 'microServiceChainLink' from '''TasksConfigsSetUnitVariable'''. Unit variables can be accessed by any microservice and used as a permanent store associated with a unit. The '''UnitVariables.microServiceChainLink''' is usually used by [[ #Get Unit Variable MicroServiceChainLink | get unit variable]] to determine which MicroServiceChainLink to run next. | For SIPs and Transfers only. Inserts an entry into '''UnitVariables''' with a foreign key back to the SIP or Transfer, and values 'variable', 'variableValue' and 'microServiceChainLink' from '''TasksConfigsSetUnitVariable'''. Unit variables can be accessed by any microservice and used as a permanent store associated with a unit. The '''UnitVariables.microServiceChainLink''' is usually used by [[ #Get Unit Variable MicroServiceChainLink | get unit variable]] to determine which MicroServiceChainLink to run next. | ||
Line 90: | Line 92: | ||
* '''Description in TaskTypes''': linkTaskManagerUnitVariableLinkPull | * '''Description in TaskTypes''': linkTaskManagerUnitVariableLinkPull | ||
* '''LinkTaskMananger''': linkTaskManagerUnitVariableLinkPull | * '''LinkTaskMananger''': linkTaskManagerUnitVariableLinkPull | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#TasksConfigsUnitVariableLinkPull | TasksConfigsUnitVariableLinkPull]] |
For SIPs and Transfers only. Looks in the '''UnitVariables''' table for variable with the correct name associated with the unit. If one is found, go to the microServiceChainLink specified, otherwise go to the defaultMicroServiceChainLink. | For SIPs and Transfers only. Looks in the '''UnitVariables''' table for variable with the correct name associated with the unit. If one is found, go to the microServiceChainLink specified, otherwise go to the defaultMicroServiceChainLink. | ||
Line 99: | Line 101: | ||
* '''Description in TaskTypes''': Split creating Jobs for each file | * '''Description in TaskTypes''': Split creating Jobs for each file | ||
* '''LinkTaskMananger''': linkTaskManagerSplit | * '''LinkTaskMananger''': linkTaskManagerSplit | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#TasksConfigsStartLinkForEachFile | TasksConfigsStartLinkForEachFile]] |
Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons. | Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons. | ||
Line 106: | Line 108: | ||
* '''Description in TaskTypes''': Split Job into many links based on file ID | * '''Description in TaskTypes''': Split Job into many links based on file ID | ||
* '''LinkTaskMananger''': linkTaskManagerSplitOnFileIdAndruleset | * '''LinkTaskMananger''': linkTaskManagerSplitOnFileIdAndruleset | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#StandardTasksConfigs | StandardTasksConfigs]] |
Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons. | Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons. | ||
− | === Transcode === | + | === Transcode - Removed === |
* '''UUID''': 5e70152a-9c5b-4c17-b823-c9298c546eeb | * '''UUID''': 5e70152a-9c5b-4c17-b823-c9298c546eeb | ||
* '''Description in TaskTypes''': Transcoder task type | * '''Description in TaskTypes''': Transcoder task type | ||
* '''LinkTaskMananger''': linkTaskManagerTranscoderCommand | * '''LinkTaskMananger''': linkTaskManagerTranscoderCommand | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#CommandRelationships | CommandRelationships]] |
Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons. | Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons. | ||
== Magic Links - Deprecated == | == Magic Links - Deprecated == | ||
+ | |||
+ | Removed in https://github.com/artefactual/archivematica/pull/948, will be part of Archivematica v1.8.0. | ||
=== Set Magic Link - Deprecated === | === Set Magic Link - Deprecated === | ||
Line 122: | Line 126: | ||
* '''Description in TaskTypes''': assign magic link | * '''Description in TaskTypes''': assign magic link | ||
* '''LinkTaskMananger''': linkTaskManagerAssignMagicLink | * '''LinkTaskMananger''': linkTaskManagerAssignMagicLink | ||
− | * '''TaskTypePKReference''': Foreign key to [[ | + | * '''TaskTypePKReference''': Foreign key to [[ MCPServer#TasksConfigsAssignMagicLink | TasksConfigsAssignMagicLink]] |
For SIPs and Transfers only. Sets the SIPs.magicLink or Transfers.magicLink to TasksConfigsAssignMagicLink.execute, and magicLinkExitMessage to the default value of "Completed successfully". Next time Get Magic Link is called, it will go to that MicroServiceChainLink. | For SIPs and Transfers only. Sets the SIPs.magicLink or Transfers.magicLink to TasksConfigsAssignMagicLink.execute, and magicLinkExitMessage to the default value of "Completed successfully". Next time Get Magic Link is called, it will go to that MicroServiceChainLink. | ||
Latest revision as of 15:57, 11 February 2020
Main Page > Development > Development documentation > MCPServer > TaskTypes
Design
This page proposes a new feature and reviews design options
Development
This page describes a feature that's in development
Documentation
This page documents an implemented feature
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.
General[edit]
Run once[edit]
- UUID: 36b2e239-4a57-4aa5-8ebc-7a29139baca6
- Description in TaskTypes: one instance
- LinkTaskMananger: linkTaskManagerDirectories
- TaskTypePKReference: Foreign key to StandardTasksConfigs
Run the command listed in StandardTasksConfigs exactly once. TODO filterSubDir?
Run for each file[edit]
- UUID: a6b1c323-7d36-428e-846a-e7e819423577
- Description in TaskTypes: for each file
- LinkTaskMananger: linkTaskManagerFiles
- TaskTypePKReference: Foreign key 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)
User Choice[edit]
Get User Choice - select chain[edit]
- UUID: 61fb3874-8ef6-49d3-8a2d-3cb66e86a30c
- Description in TaskTypes: get user choice to proceed with
- LinkTaskMananger: linkTaskManagerChoice
- TaskTypePKReference: Foreign key 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[edit]
- UUID: 9c84b047-9a6d-463f-9836-eafa49743b84
- Description in TaskTypes: get replacement dic from user choice
- LinkTaskMananger: linkTaskManagerReplacementDicFromChoice
- TaskTypePKReference: Foreign key 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).
NOTE: The replacement variables no longer disappear when a new MicroServiceChain is started.
Generate User Choice in MicroService[edit]
- UUID: a19bfd9f-9989-4648-9351-013a10b382ed
- Description in TaskTypes: Get microservice generated list in stdOut
- LinkTaskMananger: linkTaskManagerGetMicroserviceGeneratedListInStdOut
- TaskTypePKReference: Foreign key 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[edit]
- UUID: 01b748fe-2e9d-44e4-ae5d-113f74c9a0ba
- Description in TaskTypes: Get user choice from microservice generated list
- LinkTaskMananger: linkTaskManagerGetUserChoiceFromMicroserviceGeneratedList
- TaskTypePKReference: Foreign key 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.
NOTE: The replacement variables no longer disappear when a new MicroServiceChain is started, because the Unit is recreated.
Unit Variables[edit]
Set Unit Variable[edit]
- UUID: 6f0b612c-867f-4dfd-8e43-5b35b7f882d7
- Description in TaskTypes: linkTaskManagerSetUnitVariable
- LinkTaskMananger: linkTaskManagerSetUnitVariable
- TaskTypePKReference: Foreign key to TasksConfigsSetUnitVariable
For SIPs and Transfers only. Inserts an entry into UnitVariables with a foreign key back to the SIP or Transfer, and values 'variable', 'variableValue' and 'microServiceChainLink' from TasksConfigsSetUnitVariable. Unit variables can be accessed by any microservice and used as a permanent store associated with a unit. The UnitVariables.microServiceChainLink is usually used by get unit variable to determine which MicroServiceChainLink to run next.
Get Unit Variable MicroServiceChainLink[edit]
- UUID: c42184a3-1a7f-4c4d-b380-15d8d97fdd11
- Description in TaskTypes: linkTaskManagerUnitVariableLinkPull
- LinkTaskMananger: linkTaskManagerUnitVariableLinkPull
- TaskTypePKReference: Foreign key to TasksConfigsUnitVariableLinkPull
For SIPs and Transfers only. Looks in the UnitVariables table for variable with the correct name associated with the unit. If one is found, go to the microServiceChainLink specified, otherwise go to the defaultMicroServiceChainLink.
Transcoding - Removed[edit]
Split based on File - Removed[edit]
- UUID: 75cf8446-1cb0-474c-8245-75850d328e91
- Description in TaskTypes: Split creating Jobs for each file
- LinkTaskMananger: linkTaskManagerSplit
- TaskTypePKReference: Foreign key to TasksConfigsStartLinkForEachFile
Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons.
Split based on File and Ruleset - Removed[edit]
- UUID: 405b061b-361e-4e75-be27-834a1bc25f5c
- Description in TaskTypes: Split Job into many links based on file ID
- LinkTaskMananger: linkTaskManagerSplitOnFileIdAndruleset
- TaskTypePKReference: Foreign key to StandardTasksConfigs
Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons.
Transcode - Removed[edit]
- UUID: 5e70152a-9c5b-4c17-b823-c9298c546eeb
- Description in TaskTypes: Transcoder task type
- LinkTaskMananger: linkTaskManagerTranscoderCommand
- TaskTypePKReference: Foreign key to CommandRelationships
Part of the pre-FPR way of handling transcoding. Removed - documentation kept for historical reasons.
Magic Links - Deprecated[edit]
Removed in https://github.com/artefactual/archivematica/pull/948, will be part of Archivematica v1.8.0.
Set Magic Link - Deprecated[edit]
- UUID: 3590f73d-5eb0-44a0-91a6-5b2db6655889
- Description in TaskTypes: assign magic link
- LinkTaskMananger: linkTaskManagerAssignMagicLink
- TaskTypePKReference: Foreign key to TasksConfigsAssignMagicLink
For SIPs and Transfers only. Sets the SIPs.magicLink or Transfers.magicLink to TasksConfigsAssignMagicLink.execute, and magicLinkExitMessage to the default value of "Completed successfully". Next time Get Magic Link is called, it will go to that MicroServiceChainLink.
Get Magic Link - Deprecated[edit]
- UUID: 6fe259c2-459d-4d4b-81a4-1b9daf7ee2e9
- Description in TaskTypes: goto magic link
- LinkTaskMananger: linkTaskManagerLoadMagicLink
- TaskTypePKReference: NULL
For SIPs and Transfers only, looks at magicLink and magicLinkExitMessage in the SIPs or Transfers table, and goes to that link.