-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
568 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...AActivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<sap:ActivityDesigner x:Class="Indico.RPAActivities.Activities.Design.Designers.ListWithTimeoutDesigner" | ||
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" | ||
xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation" | ||
xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation" | ||
xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation" | ||
xmlns:converters="clr-namespace:UiPath.Shared.Activities.Design.Converters" | ||
xmlns:uip="clr-namespace:UiPath.Shared.Activities.Design.Controls"> | ||
|
||
<sap:ActivityDesigner.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="..\Themes\Generic.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
<sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" /> | ||
<converters:ActivityIconConverter x:Key="ActivityIconConverter" /> | ||
</ResourceDictionary> | ||
</sap:ActivityDesigner.Resources> | ||
|
||
<sap:ActivityDesigner.Icon> | ||
<DrawingBrush Stretch="Uniform" Drawing="{Binding Path=ModelItem, Converter={StaticResource ActivityIconConverter}, ConverterParameter=pack://application:\,\,\,/Indico.RPAActivities.Activities.Design;component/themes/icons.xaml}" /> | ||
</sap:ActivityDesigner.Icon> | ||
|
||
</sap:ActivityDesigner> |
13 changes: 13 additions & 0 deletions
13
...tivities/Indico.RPAActivities.Activities.Design/Designers/ListWithTimeoutDesigner.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Indico.RPAActivities.Activities.Design.Designers | ||
{ | ||
/// <summary> | ||
/// Interaction logic for ListWithTimeoutDesigner.xaml | ||
/// </summary> | ||
public partial class ListWithTimeoutDesigner | ||
{ | ||
public ListWithTimeoutDesigner() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 27 additions & 4 deletions
31
Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/Common/IndicoActivityBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
using System.Activities; | ||
using System; | ||
using System.Activities; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Indico.RPAActivities.Activities.Properties; | ||
using IndicoV2.Submissions.Models; | ||
using UiPath.Shared.Activities; | ||
using UiPath.Shared.Activities.Localization; | ||
using UiPath.Shared.Activities.Utilities; | ||
|
||
namespace Indico.RPAActivities.Activities.Activities | ||
{ | ||
public abstract class IndicoActivityBase<TInput, TOutput> : ContinuableAsyncCodeActivity | ||
public abstract class IndicoActivityBase<TInput, TOutput> : ContinuableAsyncCodeActivity | ||
{ | ||
protected Application Application { get; private set; } | ||
|
||
|
||
[LocalizedCategory(nameof(Resources.Common_Category))] | ||
[LocalizedDisplayName(nameof(Resources.Timeout_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.Timeout_Description))] | ||
public InArgument<int> TimeoutMS { get; set; } = 60000; | ||
|
||
[LocalizedCategory(nameof(Resources.Common_Category))] | ||
[LocalizedDisplayName(nameof(Resources.ContinueOnError_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.ContinueOnError_Description))] | ||
public override InArgument<bool> ContinueOnError { get; set; } | ||
|
||
protected IndicoActivityBase() | ||
{ | ||
Constraints.Add(ActivityConstraints.HasParentType<IndicoActivityBase<TInput, TOutput>, IndicoScope>(string.Format(Resources.ValidationScope_Error, Resources.IndicoScope_DisplayName))); | ||
|
||
} | ||
|
||
protected override void Init(AsyncCodeActivityContext context) | ||
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) | ||
{ | ||
var objectContainer = context.GetFromContext<IObjectContainer>(IndicoScope.ParentContainerPropertyTag); | ||
Application = objectContainer.Get<Application>(); | ||
|
||
return base.BeginExecute(context, callback, state); | ||
|
||
} | ||
|
||
protected abstract void Results(AsyncCodeActivityContext context, IEnumerable<TOutput> result); | ||
|
||
protected abstract Task<TOutput> ExecuteWithTimeout(AsyncCodeActivityContext context, CancellationToken cancellationToken = default); | ||
} | ||
} |
68 changes: 34 additions & 34 deletions
68
Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/DocumentExtraction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
using System.Activities; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Indico.RPAActivities.Activities.Activities; | ||
using Indico.RPAActivities.Activities.Properties; | ||
using UiPath.Shared.Activities.Localization; | ||
using IndicoV2.Ocr.Models; | ||
//using System.Activities; | ||
//using System.Threading; | ||
//using System.Threading.Tasks; | ||
//using Indico.RPAActivities.Activities.Activities; | ||
//using Indico.RPAActivities.Activities.Properties; | ||
//using UiPath.Shared.Activities.Localization; | ||
//using IndicoV2.Ocr.Models; | ||
|
||
namespace Indico.RPAActivities.Activities | ||
{ | ||
[LocalizedCategory(nameof(Resources.OCRCategory))] | ||
[LocalizedDisplayName(nameof(Resources.DocumentExtraction_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.DocumentExtraction_Description))] | ||
public class DocumentExtraction : IndicoActivityBase<(DocumentExtractionPreset Preset, string Document), string> | ||
{ | ||
[LocalizedDisplayName(nameof(Resources.DocumentExtraction_ConfigType_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.DocumentExtraction_ConfigType_Description))] | ||
[LocalizedCategory(nameof(Resources.Input_Category))] | ||
public InArgument<DocumentExtractionPreset> Preset { get; set; } = DocumentExtractionPreset.Standard; | ||
//namespace Indico.RPAActivities.Activities | ||
//{ | ||
// [LocalizedCategory(nameof(Resources.OCRCategory))] | ||
// [LocalizedDisplayName(nameof(Resources.DocumentExtraction_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.DocumentExtraction_Description))] | ||
// public class DocumentExtraction : IndicoActivityBase<(DocumentExtractionPreset Preset, string Document), string> | ||
// { | ||
// [LocalizedDisplayName(nameof(Resources.DocumentExtraction_ConfigType_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.DocumentExtraction_ConfigType_Description))] | ||
// [LocalizedCategory(nameof(Resources.Input_Category))] | ||
// public InArgument<DocumentExtractionPreset> Preset { get; set; } = DocumentExtractionPreset.Standard; | ||
|
||
[LocalizedDisplayName(nameof(Resources.DocumentExtraction_Document_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.DocumentExtraction_Document_Description))] | ||
[LocalizedCategory(nameof(Resources.Input_Category))] | ||
[RequiredArgument] | ||
public InArgument<string> Document { get; set; } | ||
// [LocalizedDisplayName(nameof(Resources.DocumentExtraction_Document_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.DocumentExtraction_Document_Description))] | ||
// [LocalizedCategory(nameof(Resources.Input_Category))] | ||
// [RequiredArgument] | ||
// public InArgument<string> Document { get; set; } | ||
|
||
[LocalizedDisplayName(nameof(Resources.DocumentExtraction_Results_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.DocumentExtraction_Results_Description))] | ||
[LocalizedCategory(nameof(Resources.Output_Category))] | ||
public OutArgument<string> Results { get; set; } | ||
// [LocalizedDisplayName(nameof(Resources.DocumentExtraction_Results_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.DocumentExtraction_Results_Description))] | ||
// [LocalizedCategory(nameof(Resources.Output_Category))] | ||
// public OutArgument<string> Results { get; set; } | ||
|
||
protected override (DocumentExtractionPreset Preset, string Document) GetInputs(AsyncCodeActivityContext ctx) => | ||
(Preset.Get(ctx), Document.Get(ctx)); | ||
// protected override (DocumentExtractionPreset Preset, string Document) GetInputs(AsyncCodeActivityContext ctx) => | ||
// (Preset.Get(ctx), Document.Get(ctx)); | ||
|
||
protected override async Task<string> ExecuteAsync((DocumentExtractionPreset Preset, string Document) input, CancellationToken cancellationToken) | ||
=> await Application.ExtractDocument(input.Document, input.Preset, cancellationToken); | ||
// protected override async Task<string> ExecuteAsync((DocumentExtractionPreset Preset, string Document) input, CancellationToken cancellationToken) | ||
// => await Application.ExtractDocument(input.Document, input.Preset, cancellationToken); | ||
|
||
protected override void SetOutputs(AsyncCodeActivityContext ctx, string output) => Results.Set(ctx, output); | ||
} | ||
} | ||
// protected override void SetOutputs(AsyncCodeActivityContext ctx, string output) => Results.Set(ctx, output); | ||
// } | ||
//} | ||
|
64 changes: 32 additions & 32 deletions
64
Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/GenerateSubmissionResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
using System.Activities; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Indico.RPAActivities.Activities.Activities; | ||
using Newtonsoft.Json.Linq; | ||
using Indico.RPAActivities.Activities.Properties; | ||
using UiPath.Shared.Activities.Localization; | ||
using IndicoV2.Submissions.Models; | ||
using System; | ||
//using System.Activities; | ||
//using System.Threading; | ||
//using System.Threading.Tasks; | ||
//using Indico.RPAActivities.Activities.Activities; | ||
//using Newtonsoft.Json.Linq; | ||
//using Indico.RPAActivities.Activities.Properties; | ||
//using UiPath.Shared.Activities.Localization; | ||
//using IndicoV2.Submissions.Models; | ||
//using System; | ||
|
||
namespace Indico.RPAActivities.Activities | ||
{ | ||
[LocalizedCategory(nameof(Resources.SubmissionCategory))] | ||
[LocalizedDisplayName(nameof(Resources.GenerateSubmissionResult_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.GenerateSubmissionResult_Description))] | ||
public class GenerateSubmissionResult : IndicoActivityBase<int, string> | ||
{ | ||
[LocalizedDisplayName(nameof(Resources.GenerateSubmissionResult_SubmissionID_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.GenerateSubmissionResult_SubmissionID_Description))] | ||
[LocalizedCategory(nameof(Resources.Input_Category))] | ||
[RequiredArgument] | ||
public InArgument<int> SubmissionID { get; set; } | ||
//namespace Indico.RPAActivities.Activities | ||
//{ | ||
// [LocalizedCategory(nameof(Resources.SubmissionCategory))] | ||
// [LocalizedDisplayName(nameof(Resources.GenerateSubmissionResult_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.GenerateSubmissionResult_Description))] | ||
// public class GenerateSubmissionResult : IndicoActivityBase<int, string> | ||
// { | ||
// [LocalizedDisplayName(nameof(Resources.GenerateSubmissionResult_SubmissionID_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.GenerateSubmissionResult_SubmissionID_Description))] | ||
// [LocalizedCategory(nameof(Resources.Input_Category))] | ||
// [RequiredArgument] | ||
// public InArgument<int> SubmissionID { get; set; } | ||
|
||
[LocalizedDisplayName(nameof(Resources.GenerateSubmissionResult_Result_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.GenerateSubmissionResult_Result_Description))] | ||
[LocalizedCategory(nameof(Resources.Output_Category))] | ||
public OutArgument<string> Result { get; set; } | ||
// [LocalizedDisplayName(nameof(Resources.GenerateSubmissionResult_Result_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.GenerateSubmissionResult_Result_Description))] | ||
// [LocalizedCategory(nameof(Resources.Output_Category))] | ||
// public OutArgument<string> Result { get; set; } | ||
|
||
protected override int GetInputs(AsyncCodeActivityContext ctx) => | ||
SubmissionID.Get(ctx); | ||
// protected override int GetInputs(AsyncCodeActivityContext ctx) => | ||
// SubmissionID.Get(ctx); | ||
|
||
protected override Task<string> ExecuteAsync(int input, CancellationToken cancellationToken) => | ||
Application.GenerateSubmissionResult(input, cancellationToken); | ||
// protected override Task<string> ExecuteAsync(int input, CancellationToken cancellationToken) => | ||
// Application.GenerateSubmissionResult(input, cancellationToken); | ||
|
||
protected override void SetOutputs(AsyncCodeActivityContext ctx, string output) => Result.Set(ctx, output); | ||
} | ||
} | ||
// protected override void SetOutputs(AsyncCodeActivityContext ctx, string output) => Result.Set(ctx, output); | ||
// } | ||
//} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 27 additions & 27 deletions
54
Indico.RPAActivities/Indico.RPAActivities.Activities/Activities/ListDatasets.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
using System.Activities; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Indico.RPAActivities.Activities.Activities; | ||
using Indico.RPAActivities.Activities.Properties; | ||
using UiPath.Shared.Activities.Localization; | ||
using IndicoV2.DataSets.Models; | ||
//using System.Activities; | ||
//using System.Threading; | ||
//using System.Threading.Tasks; | ||
//using System.Collections.Generic; | ||
//using System.Linq; | ||
//using Indico.RPAActivities.Activities.Activities; | ||
//using Indico.RPAActivities.Activities.Properties; | ||
//using UiPath.Shared.Activities.Localization; | ||
//using IndicoV2.DataSets.Models; | ||
|
||
namespace Indico.RPAActivities.Activities | ||
{ | ||
[LocalizedCategory(nameof(Resources.PreparationCategory))] | ||
[LocalizedDisplayName(nameof(Resources.ListDatasets_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.ListDatasets_Description))] | ||
public class ListDatasets : IndicoActivityBase<bool, List<IDataSetFull>> | ||
{ | ||
[LocalizedDisplayName(nameof(Resources.ListDatasets_Datasets_DisplayName))] | ||
[LocalizedDescription(nameof(Resources.ListDatasets_Datasets_Description))] | ||
[LocalizedCategory(nameof(Resources.Output_Category))] | ||
public OutArgument<List<IDataSetFull>> Datasets { get; set; } | ||
//namespace Indico.RPAActivities.Activities | ||
//{ | ||
// [LocalizedCategory(nameof(Resources.PreparationCategory))] | ||
// [LocalizedDisplayName(nameof(Resources.ListDatasets_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.ListDatasets_Description))] | ||
// public class ListDatasets : IndicoActivityBase<bool, List<IDataSetFull>> | ||
// { | ||
// [LocalizedDisplayName(nameof(Resources.ListDatasets_Datasets_DisplayName))] | ||
// [LocalizedDescription(nameof(Resources.ListDatasets_Datasets_Description))] | ||
// [LocalizedCategory(nameof(Resources.Output_Category))] | ||
// public OutArgument<List<IDataSetFull>> Datasets { get; set; } | ||
|
||
protected override bool GetInputs(AsyncCodeActivityContext ctx) => true; // no input, using dummy bool | ||
// protected override bool GetInputs(AsyncCodeActivityContext ctx) => true; // no input, using dummy bool | ||
|
||
protected override async Task<List<IDataSetFull>> ExecuteAsync(bool input, CancellationToken cancellationToken) => | ||
(await Application.ListDatasets(cancellationToken)).ToList(); | ||
// protected override async Task<List<IDataSetFull>> ExecuteAsync(bool input, CancellationToken cancellationToken) => | ||
// (await Application.ListDatasets(cancellationToken)).ToList(); | ||
|
||
protected override void SetOutputs(AsyncCodeActivityContext ctx, List<IDataSetFull> output) => | ||
Datasets.Set(ctx, output); | ||
} | ||
} | ||
// protected override void SetOutputs(AsyncCodeActivityContext ctx, List<IDataSetFull> output) => | ||
// Datasets.Set(ctx, output); | ||
// } | ||
//} | ||
|
Oops, something went wrong.