Skip to content

Commit

Permalink
finalize update
Browse files Browse the repository at this point in the history
  • Loading branch information
goatrocks committed May 19, 2022
1 parent a1b1b8c commit d632c4a
Show file tree
Hide file tree
Showing 14 changed files with 162 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<sap:ActivityDesigner x:Class="Indico.RPAActivities.Activities.Design.Designers.ListWithTimeoutDesigner"
<sap:ActivityDesigner x:Class="Indico.RPAActivities.Activities.Design.Designers.MarkSubmissionRetrievedDesigner"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:activity="clr-namespace:Indico.RPAActivities.Activities.Properties;assembly=Indico.RPAActivities.Activities"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Indico.RPAActivities.Activities.Design.Designers
{
/// <summary>
/// Interaction logic for MarkSubmissionRetrievedDesigner.xaml
/// </summary>
public partial class MarkSubmissionRetrievedDesigner
{
public MarkSubmissionRetrievedDesigner()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
</PropertyGroup>
<!-- Package Versions -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug' AND '$(DesignTimeBuild)' != 'true'">
<PackageVersion>2.4.4.$([System.DateTime]::UtcNow.ToString(MMddHHmm))</PackageVersion>
<PackageVersion>2.5.0.$([System.DateTime]::UtcNow.ToString(MMddHHmm))</PackageVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PackageVersion>2.3.4</PackageVersion>
<PackageVersion>2.5.0</PackageVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Designers\DocumentExtractionDesigner.xaml" />
Expand All @@ -37,8 +37,8 @@
<None Remove="Designers\IndicoScopeDesigner.xaml" />
<None Remove="Designers\ListDatasetsDesigner.xaml" />
<None Remove="Designers\ListSubmissionsDesigner.xaml" />
<None Remove="Designers\ListWithTimeoutDesigner.xaml" />
<None Remove="Designers\ListWorkflowsDesigner.xaml" />
<None Remove="Designers\MarkSubmissionRetrievedDesigner.xaml" />
<None Remove="Designers\SubmissionResultDesigner.xaml" />
<None Remove="Designers\SubmitReviewDesigner.xaml" />
<None Remove="Designers\WorkflowSubmissionDesigner.xaml" />
Expand Down Expand Up @@ -107,12 +107,12 @@
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Page>
<Page Include="Designers\ListWithTimeoutDesigner.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</Page>
<Page Include="Designers\ListWorkflowsDesigner.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</Page>
<Page Include="Designers\MarkSubmissionRetrievedDesigner.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</Page>
<Page Include="Designers\SubmissionResultDesigner.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</Page>
Expand All @@ -136,7 +136,7 @@
<ItemGroup>
<!--workaround: required so nuget packages have all required dependencies-->
<ProjectReference Include="..\Indico.RPAActivities\Indico.RPAActivities.csproj" PrivateAssets="All" />
<PackageReference Include="IndicoClient" Version="2.1.0" />
<PackageReference Include="IndicoClient" Version="2.4.0-alpha1" />
<!--workaround: required so nuget packages have all required dependencies-->
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class GenerateSubmissionResult : IndicoActivityBase<int, string>
protected override int GetInputs(AsyncCodeActivityContext ctx) =>
SubmissionID.Get(ctx);

protected override Task<string> ExecuteWithTimeout(int input, CancellationToken cancellationToken) =>
Application.GenerateSubmissionResult(input, cancellationToken);
protected async override Task<string> ExecuteWithTimeout(int input, CancellationToken cancellationToken) =>
await Application.GenerateSubmissionResult(input, cancellationToken);

protected override void SetResults(AsyncCodeActivityContext ctx, string output) => Result.Set(ctx, output);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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<int, ISubmission>
{
[LocalizedDisplayName(nameof(Resources.MarkSubmissionRetrieved_SubmissionID_DisplayName))]
[LocalizedDescription(nameof(Resources.MarkSubmissionRetrieved_SubmissionID_Description))]
[LocalizedCategory(nameof(Resources.Input_Category))]
[RequiredArgument]
public InArgument<int> SubmissionID { get; set; }

[LocalizedDisplayName(nameof(Resources.MarkSubmissionRetrieved_Result_DisplayName))]
[LocalizedDescription(nameof(Resources.MarkSubmissionRetrieved_Result_Description))]
[LocalizedCategory(nameof(Resources.Output_Category))]
public OutArgument<ISubmission> Result { get; set; }

protected override int GetInputs(AsyncCodeActivityContext ctx)
{
return (SubmissionID.Get(ctx));
}

protected async override Task<ISubmission> ExecuteWithTimeout(int input, CancellationToken cancellationToken) =>
await Application.MarkSubmissionAsRetrieved(input, true, cancellationToken);

protected override void SetResults(AsyncCodeActivityContext ctx, ISubmission output) => Result.Set(ctx, output);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<JObject> 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<JObject> 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);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,28 @@
<value>Continue On Error</value>
<comment>property name</comment>
</data>
<data name="MarkSubmissionRetrieved_DisplayName" xml:space="preserve">
<value>MarkSubmissionRetrieved</value>
<comment>activity name</comment>
</data>
<data name="MarkSubmissionRetrieved_Description" xml:space="preserve">
<value>Marks a submission as retrieved</value>
<comment>activity description</comment>
</data>
<data name="MarkSubmissionRetrieved_Result_Description" xml:space="preserve">
<value>Result after update</value>
<comment>property description</comment>
</data>
<data name="MarkSubmissionRetrieved_Result_DisplayName" xml:space="preserve">
<value>Result</value>
<comment>property name</comment>
</data>
<data name="MarkSubmissionRetrieved_SubmissionID_Description" xml:space="preserve">
<value>Submission id to mark as retrieved</value>
<comment>property description</comment>
</data>
<data name="MarkSubmissionRetrieved_SubmissionID_DisplayName" xml:space="preserve">
<value>Submission Id</value>
<comment>property name</comment>
</data>
</root>
6 changes: 5 additions & 1 deletion Indico.RPAActivities/Indico.RPAActivities/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using IndicoV2.Submissions.Models;
using IndicoV2.Workflows.Models;
using Newtonsoft.Json.Linq;
using IndicoV2.V1Adapters.Submissions;

namespace Indico.RPAActivities
{
Expand Down Expand Up @@ -58,7 +59,8 @@ public async Task<IEnumerable<int>> 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)
{
Expand All @@ -68,6 +70,8 @@ public async Task<IEnumerable<int>> WorkflowSubmission(int workflowId, IEnumerab
return result;
}

public async Task<ISubmission> MarkSubmissionAsRetrieved(int submissionId, bool retrieved, CancellationToken cancellationToken = default) => await _client.Submissions().MarkSubmissionAsRetrieved(submissionId, retrieved, cancellationToken);

public async Task<JObject> SubmissionResult(int submissionId, SubmissionStatus? checkStatus, CancellationToken cancellationToken = default)
=> checkStatus.HasValue
? await _client.GetSubmissionResultAwaiter().WaitReady(submissionId, checkStatus.Value, _checkInterval, cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IndicoClient" Version="2.1.0" />
<PackageReference Include="IndicoClient" Version="2.4.0-alpha1" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
10 changes: 10 additions & 0 deletions Shared/UiPath.Shared.Activities/Runtime/TaskActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Indico.UiPath.Shared.Activities.RuntimeSimple
{
class TaskActivity
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<SharedGUID>4546856d-ea50-45c6-9419-eeeacb5a80aa</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>UiPath.Shared.Activities</Import_RootNamespace>
<Import_RootNamespace>Indico.UiPath.Shared.Activities</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)ActivitiesConstraints.cs" />
Expand All @@ -18,6 +18,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Runtime\AsyncTaskCodeActivity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Runtime\AsyncTaskNativeActivity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Runtime\AsyncTaskNativeImplementation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Runtime\TaskActivity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Utilities\ChildActivityExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Runtime\BookmarkResumptionHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Runtime\ContinuableAsyncCodeActivity.cs" />
Expand Down

0 comments on commit d632c4a

Please sign in to comment.