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
741e4231
There was an error fetching the commit references. Please try again later.
Commit
741e4231
authored
4 years ago
by
Bensong Liu
Browse files
Options
Downloads
Patches
Plain Diff
revert previous change: removed explicit argument spec
parent
7fd539d6
No related branches found
No related tags found
1 merge request
!1
Allow explicit arg
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
activity.hpp
+10
-23
10 additions, 23 deletions
activity.hpp
xaml-template.hpp
+1
-0
1 addition, 0 deletions
xaml-template.hpp
xaml.gen.example.cc
+1
-2
1 addition, 2 deletions
xaml.gen.example.cc
with
12 additions
and
25 deletions
activity.hpp
+
10
−
23
View file @
741e4231
...
...
@@ -34,16 +34,13 @@ namespace CIS {
inputSettings
[
k
]
=
v
;
}
void
explicitSetRawArgument
(
string
argTypeInXaml
,
string
argValueInCSharp
)
{
explicitArgType
=
argTypeInXaml
;
explicitArgValue
=
argValueInCSharp
;
throw
std
::
runtime_error
(
"NotSupported! Activity seems doesn't support custom type inputSettings at all. Refer to commit 7fd539d6d5f6b102337da9591217b781cb71ced9 if we get new info and want to support it again. "
);
}
private
:
string
displayName
,
className
,
entityName
;
string
taskId
;
std
::
unordered_map
<
string
,
string
>
inputSettings
;
string
explicitArgType
,
explicitArgValue
;
auto
inputSettingsToCodelines
()
const
{
// Convert InputSettings Dictionary to C# code.
std
::
list
<
string
>
inputSettingStrings
;
...
...
@@ -54,29 +51,19 @@ namespace CIS {
return
rlib
::
string
(
templates
::
ACTIVITY_DICT_TEMPLATE_UNESCAPED
).
replace_once
(
"__TEMPLATE_ARG_DictLines"
,
inputSettingsString
);
}
auto
generateXaml
()
const
{
rlib
::
string
xamlCode
=
templates
::
ACTIVITY_XAML_TEMPLATE
;
string
argType
,
argValue
;
if
(
explicitArgType
.
empty
()
&&
explicitArgValue
.
empty
())
{
// no explicit argument specified.
if
(
inputSettings
.
empty
())
{
// Also no inputSettings.
xamlCode
=
templates
::
ACTIVITY_XAML_TEMPLATE_WITHOUT_INPUTSETTINGS
;
}
else
{
// Generate inputSettings.
argType
=
templates
::
ACTIVITY_DICT_TYPENAME
;
argValue
=
inputSettingsToCodelines
();
}
rlib
::
string
xamlCode
;
if
(
inputSettings
.
empty
())
{
// Also no inputSettings.
xamlCode
=
templates
::
ACTIVITY_XAML_TEMPLATE_WITHOUT_INPUTSETTINGS
;
}
else
{
// Use explicit argument.
argType
=
explicitArgType
;
argValue
=
explicitArgValue
;
// Generate inputSettings.
xamlCode
=
templates
::
ACTIVITY_XAML_TEMPLATE
;
xamlCode
.
replace
(
"__TEMPLATE_ARG_TypeName"
,
templates
::
ACTIVITY_DICT_TYPENAME
);
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_TypeValue"
,
Utility
::
HtmlEscapeString
(
inputSettingsToCodelines
()));
}
xamlCode
.
replace
(
"__TEMPLATE_ARG_TypeName"
,
argType
);
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_TypeValue"
,
Utility
::
HtmlEscapeString
(
argValue
));
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_ClassName"
,
this
->
className
);
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_DisplayName"
,
this
->
displayName
);
xamlCode
.
replace_once
(
"__TEMPLATE_ARG_TaskId"
,
this
->
taskId
);
...
...
This diff is collapsed.
Click to expand it.
xaml-template.hpp
+
1
−
0
View file @
741e4231
...
...
@@ -24,6 +24,7 @@ R"XAMLTL( <mwcwa:ControlledActivity ClassName="__TEMPLATE_ARG_ClassName" Disp
</mwcwa:ControlledActivity>
)XAMLTL"
;
// This 2 variable below were designed to support custom TypeArguments type, but CIS seems not support it...
constexpr
auto
ACTIVITY_DICT_TYPENAME
=
"scg:Dictionary(x:String, x:String)"
;
constexpr
auto
ACTIVITY_DICT_TEMPLATE_UNESCAPED
=
R"XAMLTL( new Dictionary<string, string>()
...
...
This diff is collapsed.
Click to expand it.
xaml.gen.example.cc
+
1
−
2
View file @
741e4231
...
...
@@ -32,8 +32,7 @@ auto complexExample() {
DEFINE_ACTIVITY
(
TSConfigAndInterop
,
"PreRteg.InitiateBareMetalComplete"
)
// All Names of activity should not contain quotation mark (")
Activity
OneMoreMagicActivity
(
"MyName Contains Symbols: {(<&>)}"
,
"FleetAGC.Workflow.Magic"
);
OneMoreMagicActivity
.
explicitSetRawArgument
(
"x:Boolean"
,
"(0b_1100_1000 | 0b_1000_0001 == 201)"
);
Activity
OneMoreMagicActivity
(
"MyName Contains Symbols: {(&)} <>"
,
"FleetAGC.Workflow.Magic"
);
auto
block1
=
SCS
>>
(
SearchAnalytics
|
(
SearchFarms
>>
(
ClassisSearchUX
|
ModernSearch
)));
auto
block3
=
Loki
>>
Yggdrasil
>>
OfficeGraph
;
...
...
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