Difference between revisions of "Creating Custom Workflows 0.8 alpha"

From Archivematica
Jump to navigation Jump to search
Line 8: Line 8:
  
 
[http://youtu.be/haotj_NlbX0 video]
 
[http://youtu.be/haotj_NlbX0 video]
 +
* Paths may be different
 +
* patch from video video
 +
<pre>
 +
Index: src/MCPServer/share/mysql
 +
===================================================================
 +
--- src/MCPServer/share/mysql (revision 2328)
 +
+++ src/MCPServer/share/mysql (working copy)
 +
@@ -2774,12 +2774,62 @@
 +
 +
 +
 +
+-- Move to regular processing watched directory. --
 +
+INSERT INTO StandardTasksConfigs (filterFileEnd, filterFileStart, filterSubDir, requiresOutputLock, standardOutputFile, standardErrorFile, execute, arguments)
 +
+    VALUES
 +
+    (NULL, NULL, NULL, FALSE, NULL, NULL, 'moveTransfer_v0.0', '"%SIPDirectory%" "%sharedPath%watchedDirectories/activeTransfers/standardTransfer/." "%SIPUUID%" "%sharedPath%" "%SIPUUID%" "%sharedPath%"');
 +
+INSERT INTO TasksConfigs (taskType, taskTypePKReference, description)
 +
+    VALUES
 +
+    (0,      LAST_INSERT_ID(), 'Move to standard transfer directory');
 +
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)   
 +
+    VALUES (@microserviceGroup, LAST_INSERT_ID(), NULL);
 +
+set @MicroServiceChainLink = LAST_INSERT_ID();
 +
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink)
 +
+    VALUES (@MicroServiceChainLink, 0, NULL);
 +
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 +
 +
 +
+-- Remove .bmp files. --
 +
+INSERT INTO StandardTasksConfigs (filterFileEnd, filterFileStart, filterSubDir, requiresOutputLock, standardOutputFile, standardErrorFile, execute, arguments)
 +
+    VALUES
 +
+    ('.bmp', NULL, 'objects', TRUE, NULL, NULL, 'remove_v0.0',  '"%relativeLocation%"');
 +
+SET @AssignfileUUIDstoobjects = LAST_INSERT_ID();
 +
+INSERT INTO TasksConfigs (taskType, taskTypePKReference, description)
 +
+    VALUES
 +
+    (1,      @AssignfileUUIDstoobjects, 'Remove .bmp files');
 +
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)   
 +
+    VALUES (@microserviceGroup, LAST_INSERT_ID(), @defaultNextChainLink);
 +
+set @MicroServiceChainLink = LAST_INSERT_ID();
 +
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink)
 +
+    VALUES (@MicroServiceChainLink, 0, @NextMicroServiceChainLink);
 +
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 +
 +
+-- Move to processing directory --
 +
+-- move to processing directory --
 +
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)   
 +
+    VALUES (@microserviceGroup, @moveToProcessingDirectoryTaskConfig, @defaultNextChainLink);
 +
+set @MicroServiceChainLink = LAST_INSERT_ID();
 +
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink)
 +
+    VALUES (@MicroServiceChainLink, 0, @NextMicroServiceChainLink);
 +
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 +
 +
+-- Set permissions --
 +
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)   
 +
+    VALUES (@microserviceGroup, @setFilePermissionsTaskConfig, @defaultNextChainLink);
 +
+set @MicroServiceChainLink = LAST_INSERT_ID();
 +
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink)
 +
+    VALUES (@MicroServiceChainLink, 0, @NextMicroServiceChainLink);
 +
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 +
 +
+/*
 +
+Watched directory watched
 +
+/var/archivematica/sharedDirectory/watchedDirectories/example1
 +
+*/
 +
+INSERT INTO MicroServiceChains (startingLink, description) VALUES (@MicroServiceChainLink,  'Remove .bmp\'s before processing');
 +
+set @MicroServiceChain = LAST_INSERT_ID();
 +
 +
+INSERT INTO WatchedDirectories (watchedDirectoryPath, chain, expectedType)
 +
+    VALUES ('%watchDirectoryPath%example1', @MicroServiceChain, @expectedTypeTransfer);
 +
 +
 +
 +
@@ -2803,6 +2853,11 @@
 +
 +
 +
 +
+
 +
+
 +
+
 +
+
 +
+
 +
-- DSPACE TRANSER --
 +
-- transfer processing complete --
 +
SET @microserviceGroup  = 'Complete transfer';
 +
</pre>
  
 
=using choices=
 
=using choices=
  
 
=using magic links=
 
=using magic links=

Revision as of 01:04, 28 February 2012

Main Page > Development > Creating Custom Workflows

read first

Creating your first workflow

Make sure you read the section "read first" (above) first.

video

  • Paths may be different
  • patch from video video
Index: src/MCPServer/share/mysql
===================================================================
--- src/MCPServer/share/mysql	(revision 2328)
+++ src/MCPServer/share/mysql	(working copy)
@@ -2774,12 +2774,62 @@
 
 
 
+-- Move to regular processing watched directory. --
+INSERT INTO StandardTasksConfigs (filterFileEnd, filterFileStart, filterSubDir, requiresOutputLock, standardOutputFile, standardErrorFile, execute, arguments)
+    VALUES
+    (NULL, NULL, NULL, FALSE, NULL, NULL, 'moveTransfer_v0.0', '"%SIPDirectory%" "%sharedPath%watchedDirectories/activeTransfers/standardTransfer/." "%SIPUUID%" "%sharedPath%" "%SIPUUID%" "%sharedPath%"');
+INSERT INTO TasksConfigs (taskType, taskTypePKReference, description)
+    VALUES
+    (0,      LAST_INSERT_ID(), 'Move to standard transfer directory');
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)    
+    VALUES (@microserviceGroup, LAST_INSERT_ID(), NULL);
+set @MicroServiceChainLink = LAST_INSERT_ID();
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink) 
+    VALUES (@MicroServiceChainLink, 0, NULL);
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 
 
+-- Remove .bmp files. --
+INSERT INTO StandardTasksConfigs (filterFileEnd, filterFileStart, filterSubDir, requiresOutputLock, standardOutputFile, standardErrorFile, execute, arguments)
+    VALUES
+    ('.bmp', NULL, 'objects', TRUE, NULL, NULL, 'remove_v0.0',  '"%relativeLocation%"');
+SET @AssignfileUUIDstoobjects = LAST_INSERT_ID();
+INSERT INTO TasksConfigs (taskType, taskTypePKReference, description)
+    VALUES
+    (1,      @AssignfileUUIDstoobjects, 'Remove .bmp files');
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)     
+    VALUES (@microserviceGroup, LAST_INSERT_ID(), @defaultNextChainLink);
+set @MicroServiceChainLink = LAST_INSERT_ID();
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink) 
+    VALUES (@MicroServiceChainLink, 0, @NextMicroServiceChainLink);
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 
+-- Move to processing directory --
+-- move to processing directory --
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)     
+    VALUES (@microserviceGroup, @moveToProcessingDirectoryTaskConfig, @defaultNextChainLink);
+set @MicroServiceChainLink = LAST_INSERT_ID();
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink) 
+    VALUES (@MicroServiceChainLink, 0, @NextMicroServiceChainLink);
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 
+-- Set permissions --
+INSERT INTO MicroServiceChainLinks (microserviceGroup, currentTask, defaultNextChainLink)     
+    VALUES (@microserviceGroup, @setFilePermissionsTaskConfig, @defaultNextChainLink);
+set @MicroServiceChainLink = LAST_INSERT_ID();
+INSERT INTO MicroServiceChainLinksExitCodes (microServiceChainLink, exitCode, nextMicroServiceChainLink) 
+    VALUES (@MicroServiceChainLink, 0, @NextMicroServiceChainLink);
+set @NextMicroServiceChainLink = @MicroServiceChainLink;
 
+/*
+Watched directory watched
+/var/archivematica/sharedDirectory/watchedDirectories/example1
+*/
+INSERT INTO MicroServiceChains (startingLink, description) VALUES (@MicroServiceChainLink,  'Remove .bmp\'s before processing');
+set @MicroServiceChain = LAST_INSERT_ID();
 
+INSERT INTO WatchedDirectories (watchedDirectoryPath, chain, expectedType)
+    VALUES ('%watchDirectoryPath%example1', @MicroServiceChain, @expectedTypeTransfer);
 
 
 
@@ -2803,6 +2853,11 @@
 
 
 
+
+
+
+
+
 -- DSPACE TRANSER --
 -- transfer processing complete --
 SET @microserviceGroup  = 'Complete transfer';

using choices

using magic links