Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cis-workflow-gen
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
msc
cis-workflow-gen
Commits
008e6af6
There was an error fetching the commit references. Please try again later.
Commit
008e6af6
authored
4 years ago
by
Bensong Liu
Browse files
Options
Downloads
Patches
Plain Diff
add manual operation
parent
88e52afe
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
activity.hpp
+30
-9
30 additions, 9 deletions
activity.hpp
xaml-template.hpp
+1
-1
1 addition, 1 deletion
xaml-template.hpp
xaml.gen.example.cc
+2
-1
2 additions, 1 deletion
xaml.gen.example.cc
with
33 additions
and
11 deletions
activity.hpp
+
30
−
9
View file @
008e6af6
...
...
@@ -25,16 +25,17 @@ namespace CIS {
private:
friend
Flow
;
virtual
rlib
::
string
generateXaml
()
const
=
0
;
public:
Flow
operator
>>
(
const
Flow
&
seqNext
)
const
;
Flow
operator
|
(
const
Flow
&
seqNext
)
const
;
};
class
Activity
:
p
rivate
ActivityBase
{
class
Activity
:
p
ublic
ActivityBase
{
public:
// All `Name` should not contain QuotationMark(")
Activity
(
string
displayName
,
string
className
,
string
entityName
=
""
)
:
displayName
(
Utility
::
HtmlEscapeString
(
displayName
)),
className
(
className
),
entityName
(
entityName
),
taskId
(
Utility
::
GenUUID
())
{}
Flow
operator
>>
(
const
Flow
&
seqNext
)
const
;
Flow
operator
|
(
const
Flow
&
seqNext
)
const
;
void
addInputSetting
(
string
k
,
string
v
)
{
inputSettings
[
k
]
=
v
;
}
...
...
@@ -55,7 +56,7 @@ namespace CIS {
auto
inputSettingsString
=
",
\n
"
_rs
.
join
(
inputSettingStrings
);
return
rlib
::
string
(
templates
::
ACTIVITY_DICT_TEMPLATE_UNESCAPED
).
replace_once
(
"__TEMPLATE_ARG_DictLines"
,
inputSettingsString
);
}
virtual
rlib
::
string
generateXaml
()
const
{
virtual
rlib
::
string
generateXaml
()
const
override
{
rlib
::
string
xamlCode
;
if
(
inputSettings
.
empty
())
{
...
...
@@ -80,7 +81,27 @@ namespace CIS {
}
};
class
ManualOperation
:
private
ActivityBase
{
class
ManualOperation
:
public
ActivityBase
{
public:
explicit
ManualOperation
(
string
displayName
,
string
message
=
""
,
string
entityName
=
""
)
:
displayName
(
Utility
::
HtmlEscapeString
(
displayName
)),
messageInCSharp
(
Utility
::
HtmlEscapeString
(
"
\"
"
+
message
+
"
\"
"
)),
entityName
(
entityName
)
{}
ManualOperation
&
explicitSetMessageInCSharp
(
string
messageInCSharp
)
{
this
->
messageInCSharp
=
messageInCSharp
;
return
*
this
;
}
private
:
string
displayName
,
messageInCSharp
,
entityName
;
virtual
rlib
::
string
generateXaml
()
const
override
{
rlib
::
string
xamlCode
=
templates
::
MANUAL_OPERATION_XAML
;
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_DisplayName"
,
displayName
);
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_CodeLines"
,
messageInCSharp
);
auto
entityXaml
=
this
->
entityName
==
""
?
""
:
rlib
::
string
(
templates
::
ENTITY_DEF_TEMPLATE
).
replace
(
"__TEMPLATE_ARG_EntityName"
,
this
->
entityName
);
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_EntityDefPlaceholder"
,
entityXaml
);
return
xamlCode
;
}
};
...
...
@@ -89,7 +110,7 @@ namespace CIS {
Flow
(
const
ActivityBase
&
activity
)
{
xamlCode
=
activity
.
generateXaml
();
}
Flow
(
rlib
::
string
xamlCode
)
:
xamlCode
(
xamlCode
)
{}
explicit
Flow
(
rlib
::
string
xamlCode
)
:
xamlCode
(
xamlCode
)
{}
Flow
(
const
Flow
&
another
)
:
queued
(
another
.
queued
),
xamlCode
(
another
.
xamlCode
),
prevOperationIsSequential
(
another
.
prevOperationIsSequential
)
{}
// Actually modify xamlCode on "OperationChange".
...
...
@@ -131,10 +152,10 @@ namespace CIS {
}
};
inline
Flow
Activity
::
operator
>>
(
const
Flow
&
seqNext
)
const
{
inline
Flow
Activity
Base
::
operator
>>
(
const
Flow
&
seqNext
)
const
{
return
Flow
(
*
this
)
>>
seqNext
;
}
inline
Flow
Activity
::
operator
|
(
const
Flow
&
seqNext
)
const
{
inline
Flow
Activity
Base
::
operator
|
(
const
Flow
&
seqNext
)
const
{
return
Flow
(
*
this
)
|
seqNext
;
}
...
...
@@ -147,7 +168,7 @@ namespace CIS {
std
::
list
<
string
>
xtraNamespaces
;
std
::
list
<
string
>
xtraAssemblies
;
string
className
;
Metadata
(
string
className
)
:
className
(
className
)
{}
explicit
Metadata
(
string
className
)
:
className
(
className
)
{}
Metadata
()
=
delete
;
private
:
...
...
This diff is collapsed.
Click to expand it.
xaml-template.hpp
+
1
−
1
View file @
008e6af6
...
...
@@ -96,7 +96,7 @@ constexpr auto STD_XAML_TAIL = "</Activity>";
constexpr
auto
MANUAL_OPERATION_XAML
=
R"XAML( <mwcwa:ManualOperation DeprecatedTaskId="{x:Null}" TaskId="{x:Null}" DisplayName="__TEMPLATE_ARG_DisplayName" MonitoringSystems="icm" WaitUntilFinish="True">
R"XAML( <mwcwa:ManualOperation DeprecatedTaskId="{x:Null}" TaskId="{x:Null}" DisplayName="__TEMPLATE_ARG_DisplayName" MonitoringSystems="icm" WaitUntilFinish="True"
__TEMPLATE_ARG_EntityDefPlaceholder
>
<mwcwa:ManualOperation.AdditionalContent>
<InArgument x:TypeArguments="x:String">
<mca:CSharpValue x:TypeArguments="x:String">__TEMPLATE_ARG_CodeLines</mca:CSharpValue>
...
...
This diff is collapsed.
Click to expand it.
xaml.gen.example.cc
+
2
−
1
View file @
008e6af6
#include
"activity.hpp"
#include
<cis-workflow-gen/quick-include.hpp>
auto
simpleExample
()
{
...
...
@@ -37,7 +38,7 @@ auto complexExample() {
auto
block1
=
SCS
>>
(
SearchAnalytics
|
(
SearchFarms
>>
(
ClassisSearchUX
|
ModernSearch
)));
auto
block3
=
Loki
>>
Yggdrasil
>>
OfficeGraph
;
auto
block4
=
IC3Tooling
>>
(
MonitoringSetup
|
(
MicroServices
>>
DevelopmentValidation
>>
IntegrationTesting
));
auto
completeFlow
=
(
block1
|
TSConfigAndInterop
|
block3
|
block4
)
>>
OneMoreMagicActivity
;
auto
completeFlow
=
(
block1
|
TSConfigAndInterop
|
block3
|
block4
)
>>
OneMoreMagicActivity
>>
ManualOperation
(
"Manual Op Test"
,
"Message"
)
>>
ManualOperation
(
"AnotherManual"
,
""
,
"PreRteg.TestEntity"
).
explicitSetMessageInCSharp
(
"123.ToString()"
)
;
auto
myMetadata
=
Metadata
(
"FleetAGC.Workflows.BuildTeams"
).
setXtraAssemblies
({
"FleetAGC.Workflows"
});
println
(
to_file
(
"BuildTeams.xaml"
),
completeFlow
.
generateXaml
(
myMetadata
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment