From d632c4ac0337bcc08c8b45f15cdd0231a320ac04 Mon Sep 17 00:00:00 2001 From: m c <458905+goatrocks@users.noreply.github.com> Date: Thu, 19 May 2022 14:21:30 -0400 Subject: [PATCH] finalize update --- .../DesignerMetadata.cs | 4 ++ .../Designers/ListWithTimeoutDesigner.xaml.cs | 13 ----- ...l => MarkSubmissionRetrievedDesigner.xaml} | 2 +- .../MarkSubmissionRetrievedDesigner.xaml.cs | 13 +++++ ...ico.RPAActivities.Activities.Design.csproj | 14 ++--- .../Activities/GenerateSubmissionResult.cs | 4 +- .../Activities/MarkSubmissionRetrieved.cs | 37 +++++++++++++ .../Activities/SubmitReview.cs | 4 +- .../Properties/Resources.Designer.cs | 54 +++++++++++++++++++ .../Properties/Resources.resx | 24 +++++++++ .../Indico.RPAActivities/Application.cs | 6 ++- .../Indico.RPAActivities.csproj | 2 +- .../Runtime/TaskActivity.cs | 10 ++++ .../UiPath.Shared.Activities.projitems | 3 +- 14 files changed, 162 insertions(+), 28 deletions(-) delete mode 100644 Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml.cs rename Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/{ListWithTimeoutDesigner.xaml => MarkSubmissionRetrievedDesigner.xaml} (97%) create mode 100644 Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/MarkSubmissionRetrievedDesigner.xaml.cs create mode 100644 Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/MarkSubmissionRetrieved.cs create mode 100644 Shared/UiPath.Shared.Activities/Runtime/TaskActivity.cs diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/DesignerMetadata.cs b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/DesignerMetadata.cs index f7b14f4..603d510 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/DesignerMetadata.cs +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/DesignerMetadata.cs @@ -37,6 +37,10 @@ public void Register() builder.AddCustomAttributes(typeof(SubmitReview), new DesignerAttribute(typeof(SubmitReviewDesigner))); builder.AddCustomAttributes(typeof(SubmitReview), new HelpKeywordAttribute("")); + builder.AddCustomAttributes(typeof(MarkSubmissionRetrieved), new DesignerAttribute(typeof(MarkSubmissionRetrievedDesigner))); + builder.AddCustomAttributes(typeof(MarkSubmissionRetrieved), new HelpKeywordAttribute("")); + + MetadataStore.AddAttributeTable(builder.CreateTable()); } } diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml.cs b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml.cs deleted file mode 100644 index acb973f..0000000 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Indico.RPAActivities.Activities.Design.Designers -{ - /// - /// Interaction logic for ListWithTimeoutDesigner.xaml - /// - public partial class ListWithTimeoutDesigner - { - public ListWithTimeoutDesigner() - { - InitializeComponent(); - } - } -} diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/MarkSubmissionRetrievedDesigner.xaml similarity index 97% rename from Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml rename to Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/MarkSubmissionRetrievedDesigner.xaml index ff0b75c..7fed5d9 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Designers/MarkSubmissionRetrievedDesigner.xaml @@ -1,4 +1,4 @@ - + /// Interaction logic for MarkSubmissionRetrievedDesigner.xaml + /// + public partial class MarkSubmissionRetrievedDesigner + { + public MarkSubmissionRetrievedDesigner() + { + InitializeComponent(); + } + } +} diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Indico.RPAActivities.Activities.Design.csproj b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Indico.RPAActivities.Activities.Design.csproj index 3041798..630c34c 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Indico.RPAActivities.Activities.Design.csproj +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities.Design/Indico.RPAActivities.Activities.Design.csproj @@ -25,10 +25,10 @@ - 2.4.4.$([System.DateTime]::UtcNow.ToString(MMddHHmm)) + 2.5.0.$([System.DateTime]::UtcNow.ToString(MMddHHmm)) - 2.3.4 + 2.5.0 @@ -37,8 +37,8 @@ - + @@ -107,12 +107,12 @@ MSBuild:UpdateDesignTimeXaml Never - - MSBuild:UpdateDesignTimeXaml - MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + MSBuild:UpdateDesignTimeXaml @@ -136,7 +136,7 @@ - + diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/GenerateSubmissionResult.cs b/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/GenerateSubmissionResult.cs index ec3a48b..ef56138 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/GenerateSubmissionResult.cs +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/GenerateSubmissionResult.cs @@ -28,8 +28,8 @@ public class GenerateSubmissionResult : IndicoActivityBase protected override int GetInputs(AsyncCodeActivityContext ctx) => SubmissionID.Get(ctx); - protected override Task ExecuteWithTimeout(int input, CancellationToken cancellationToken) => - Application.GenerateSubmissionResult(input, cancellationToken); + protected async override Task ExecuteWithTimeout(int input, CancellationToken cancellationToken) => + await Application.GenerateSubmissionResult(input, cancellationToken); protected override void SetResults(AsyncCodeActivityContext ctx, string output) => Result.Set(ctx, output); } diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/MarkSubmissionRetrieved.cs b/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/MarkSubmissionRetrieved.cs new file mode 100644 index 0000000..9ff5959 --- /dev/null +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/MarkSubmissionRetrieved.cs @@ -0,0 +1,37 @@ +using System.Activities; +using System.Threading; +using System.Threading.Tasks; +using Indico.RPAActivities.Activities.Activities; +using Indico.RPAActivities.Activities.Properties; +using Indico.UiPath.Shared.Activities.Localization; +using IndicoV2.Submissions.Models; + +namespace Indico.RPAActivities.Activities +{ + [LocalizedDisplayName(nameof(Resources.MarkSubmissionRetrieved_DisplayName))] + [LocalizedDescription(nameof(Resources.MarkSubmissionRetrieved_Description))] + public class MarkSubmissionRetrieved : IndicoActivityBase + { + [LocalizedDisplayName(nameof(Resources.MarkSubmissionRetrieved_SubmissionID_DisplayName))] + [LocalizedDescription(nameof(Resources.MarkSubmissionRetrieved_SubmissionID_Description))] + [LocalizedCategory(nameof(Resources.Input_Category))] + [RequiredArgument] + public InArgument SubmissionID { get; set; } + + [LocalizedDisplayName(nameof(Resources.MarkSubmissionRetrieved_Result_DisplayName))] + [LocalizedDescription(nameof(Resources.MarkSubmissionRetrieved_Result_Description))] + [LocalizedCategory(nameof(Resources.Output_Category))] + public OutArgument Result { get; set; } + + protected override int GetInputs(AsyncCodeActivityContext ctx) + { + return (SubmissionID.Get(ctx)); + } + + protected async override Task ExecuteWithTimeout(int input, CancellationToken cancellationToken) => + await Application.MarkSubmissionAsRetrieved(input, true, cancellationToken); + + protected override void SetResults(AsyncCodeActivityContext ctx, ISubmission output) => Result.Set(ctx, output); + + } +} diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/SubmitReview.cs b/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/SubmitReview.cs index d9c9e9b..964ed2c 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/SubmitReview.cs +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/SubmitReview.cs @@ -42,8 +42,8 @@ public class SubmitReview : IndicoActivityBase<(int SubmissionId, JObject Change protected override (int SubmissionId, JObject Changes, bool Rejected, bool? ForceComplete) GetInputs(AsyncCodeActivityContext ctx) => (SubmissionID.Get(ctx), Changes.Get(ctx), Rejected.Get(ctx), ForceComplete.Get(ctx)); - protected override Task ExecuteWithTimeout((int SubmissionId, JObject Changes, bool Rejected, bool? ForceComplete) input, CancellationToken cancellationToken) - => Application.SubmitReview(input.SubmissionId, input.Changes, input.Rejected, input.ForceComplete, cancellationToken); + protected async override Task ExecuteWithTimeout((int SubmissionId, JObject Changes, bool Rejected, bool? ForceComplete) input, CancellationToken cancellationToken) + => await Application.SubmitReview(input.SubmissionId, input.Changes, input.Rejected, input.ForceComplete, cancellationToken); protected override void SetResults(AsyncCodeActivityContext ctx, JObject output) => Result.Set(ctx, output); } diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.Designer.cs b/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.Designer.cs index e0d9e33..cdc6cf7 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.Designer.cs +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.Designer.cs @@ -690,6 +690,60 @@ public static string ListWorkflows_Workflows_DisplayName { } } + /// + /// Looks up a localized string similar to Marks a submission as retrieved. + /// + public static string MarkSubmissionRetrieved_Description { + get { + return ResourceManager.GetString("MarkSubmissionRetrieved_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MarkSubmissionRetrieved. + /// + public static string MarkSubmissionRetrieved_DisplayName { + get { + return ResourceManager.GetString("MarkSubmissionRetrieved_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Result after update. + /// + public static string MarkSubmissionRetrieved_Result_Description { + get { + return ResourceManager.GetString("MarkSubmissionRetrieved_Result_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Result. + /// + public static string MarkSubmissionRetrieved_Result_DisplayName { + get { + return ResourceManager.GetString("MarkSubmissionRetrieved_Result_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submission id to mark as retrieved. + /// + public static string MarkSubmissionRetrieved_SubmissionID_Description { + get { + return ResourceManager.GetString("MarkSubmissionRetrieved_SubmissionID_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submission Id. + /// + public static string MarkSubmissionRetrieved_SubmissionID_DisplayName { + get { + return ResourceManager.GetString("MarkSubmissionRetrieved_SubmissionID_DisplayName", resourceCulture); + } + } + /// /// Looks up a localized string similar to Indico.OCR. /// diff --git a/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.resx b/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.resx index 0b21f74..1bbf540 100644 --- a/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.resx +++ b/Indico.RPAActivities/Indico.RPAActivities.Activities/Properties/Resources.resx @@ -573,4 +573,28 @@ Continue On Error property name + + MarkSubmissionRetrieved + activity name + + + Marks a submission as retrieved + activity description + + + Result after update + property description + + + Result + property name + + + Submission id to mark as retrieved + property description + + + Submission Id + property name + \ No newline at end of file diff --git a/Indico.RPAActivities/Indico.RPAActivities/Application.cs b/Indico.RPAActivities/Indico.RPAActivities/Application.cs index dff4a49..d9edb7e 100644 --- a/Indico.RPAActivities/Indico.RPAActivities/Application.cs +++ b/Indico.RPAActivities/Indico.RPAActivities/Application.cs @@ -10,6 +10,7 @@ using IndicoV2.Submissions.Models; using IndicoV2.Workflows.Models; using Newtonsoft.Json.Linq; +using IndicoV2.V1Adapters.Submissions; namespace Indico.RPAActivities { @@ -58,7 +59,8 @@ public async Task> WorkflowSubmission(int workflowId, IEnumerab if (files != null) { - result = await _client.Submissions().CreateAsync(workflowId, files, cancellationToken); + + result = await _client.Submissions().CreateAsyncLegacy(workflowId, files, cancellationToken); } else if (urls != null) { @@ -68,6 +70,8 @@ public async Task> WorkflowSubmission(int workflowId, IEnumerab return result; } + public async Task MarkSubmissionAsRetrieved(int submissionId, bool retrieved, CancellationToken cancellationToken = default) => await _client.Submissions().MarkSubmissionAsRetrieved(submissionId, retrieved, cancellationToken); + public async Task SubmissionResult(int submissionId, SubmissionStatus? checkStatus, CancellationToken cancellationToken = default) => checkStatus.HasValue ? await _client.GetSubmissionResultAwaiter().WaitReady(submissionId, checkStatus.Value, _checkInterval, cancellationToken) diff --git a/Indico.RPAActivities/Indico.RPAActivities/Indico.RPAActivities.csproj b/Indico.RPAActivities/Indico.RPAActivities/Indico.RPAActivities.csproj index 6684016..0ea6d26 100644 --- a/Indico.RPAActivities/Indico.RPAActivities/Indico.RPAActivities.csproj +++ b/Indico.RPAActivities/Indico.RPAActivities/Indico.RPAActivities.csproj @@ -11,7 +11,7 @@ false - + diff --git a/Shared/UiPath.Shared.Activities/Runtime/TaskActivity.cs b/Shared/UiPath.Shared.Activities/Runtime/TaskActivity.cs new file mode 100644 index 0000000..3581d17 --- /dev/null +++ b/Shared/UiPath.Shared.Activities/Runtime/TaskActivity.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Indico.UiPath.Shared.Activities.RuntimeSimple +{ + class TaskActivity + { + } +} diff --git a/Shared/UiPath.Shared.Activities/UiPath.Shared.Activities.projitems b/Shared/UiPath.Shared.Activities/UiPath.Shared.Activities.projitems index 104ccfb..f9613fb 100644 --- a/Shared/UiPath.Shared.Activities/UiPath.Shared.Activities.projitems +++ b/Shared/UiPath.Shared.Activities/UiPath.Shared.Activities.projitems @@ -6,7 +6,7 @@ 4546856d-ea50-45c6-9419-eeeacb5a80aa - UiPath.Shared.Activities + Indico.UiPath.Shared.Activities @@ -18,6 +18,7 @@ +