-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyWithGenericPath.cs
More file actions
105 lines (91 loc) · 3.57 KB
/
CopyWithGenericPath.cs
File metadata and controls
105 lines (91 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
namespace ProcessMyMedia.Samples
{
using Microsoft.Extensions.Configuration;
using WorkflowCore.Interface;
using ProcessMyMedia.Model;
public class CopyWithGenericPath : WofkflowSampleBase<CopyWithGenericPath.CopyWithGenericPathWorkflow, CopyWithGenericPath.CopyWithGenericPathWorkflowData>
{
public CopyWithGenericPath(IConfigurationRoot configuration) : base(configuration)
{
}
protected override CopyWithGenericPathWorkflowData WorflowDatas => new CopyWithGenericPathWorkflowData()
{
FtpServer = new LinkedServiceEntity()
{
Name = "MyFtpServer",
Type = LinkedServiceType.FtpServer.ToString(),
TypeProperties = new
{
host = "localhost",
port = 21,
enableSsl = false,
authenticationType = "Basic",
username = "user",
password = new
{
type = "SecureString",
value = "password"
}
}
},
AzureStorageResource = new LinkedServiceEntity()
{
Name = "MyAzureStorage",
Type = LinkedServiceType.AzureBlobStorage.ToString(),
TypeProperties = new
{
connectionString = new
{
type = "SecureString",
value = this.configuration["SamplesConfig:StorageConnectionString"]
}
}
},
SourcePath = new GenericDataPath()
{
LinkedServiceName = "MyFtpServer",
PathProperties = new
{
folderPath = "in",
fileName = "*.mpg "
},
ActivityProperties = new
{
recursive = false
}
},
DestinationPath = new GenericDataPath()
{
LinkedServiceName = "MyAzureStorage",
PathProperties = new
{
folderPath = "outfolder"
}
}
};
public class CopyWithGenericPathWorkflow : IWorkflow<CopyWithGenericPathWorkflowData>
{
public string Id => SampleBase.WORKFLOW_NAME;
public int Version => 1;
public void Build(IWorkflowBuilder<CopyWithGenericPathWorkflowData> builder)
{
builder
.UseDefaultErrorBehavior(WorkflowCore.Models.WorkflowErrorHandling.Terminate)
.StartWith<Tasks.CreateLinkedServiceTask>()
.Input(task => task.Name, data => data.FtpServer.Name)
.Input(task => task.Type, data => data.FtpServer.Type)
.Input(task => task.Properties, data => data.FtpServer.TypeProperties)
.Then<Tasks.CopyTask>()
.Input(task => task.SourcePath, data => data.SourcePath)
.Input(task => task.DestinationPath, data => data.DestinationPath);
}
}
public class CopyWithGenericPathWorkflowData
{
public LinkedServiceEntity FtpServer { get; set; }
public LinkedServiceEntity AzureStorageResource { get; set; }
public DataPath SourcePath { get; set; }
public DataPath DestinationPath { get; set; }
}
}
}