public async Task <int> CreateProcessingSetAsync(int processingProfileArtifactId, int workspaceArtifactId)
        {
            try
            {
                Console2.WriteDisplayStartLine($"Creating Processing Set [Name: {Constants.Processing.Set.NAME}]");

                //Build the ProcessingSet object.
                ProcessingSet processingSet = new ProcessingSet
                {
                    ArtifactID = Constants.Processing.Set.ARTIFACT_ID,
                    Name       = Constants.Processing.Set.NAME,
                    Profile    = new ProcessingProfileRef(processingProfileArtifactId)
                };

                if (Constants.Processing.Set.EmailNotificationRecipients.Length > 0)
                {
                    processingSet.EmailNotificationRecipients = Constants.Processing.Set.EmailNotificationRecipients;
                }

                //Create the ProcessingSet object. The service returns the Artifact ID of the object.
                int processingSetArtifactId = await ProcessingSetManager.SaveAsync(processingSet, workspaceArtifactId);

                if (processingSetArtifactId == 0)
                {
                    throw new Exception("Failed to Create Processing Set");
                }

                Console2.WriteDebugLine($"Processing Set ArtifactId: {processingSetArtifactId}");
                Console2.WriteDisplayEndLine("Created Processing Set!");

                return(processingSetArtifactId);
            }
            catch (Exception ex)
            {
                throw new Exception("An error occured when creating Processing Set", ex);
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: chif84/AppQueue
        static void Main(string[] args)
        {
            var processingSet = new ProcessingSet();

            processingSet.Processing();
        }