Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
yecl
wecube
Commits
b6855d1e
Commit
b6855d1e
authored
4 years ago
by
gavin2lee
Browse files
Options
Download
Email Patches
Plain Diff
#2169 add context calculation
parent
ef48df16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform-core/src/main/java/com/webank/wecube/platform/core/service/workflow/PluginInvocationService.java
+47
-21
...atform/core/service/workflow/PluginInvocationService.java
with
47 additions
and
21 deletions
+47
-21
platform-core/src/main/java/com/webank/wecube/platform/core/service/workflow/PluginInvocationService.java
+
47
-
21
View file @
b6855d1e
...
...
@@ -1021,7 +1021,7 @@ public class PluginInvocationService extends AbstractPluginInvocationService {
}
}
//
TODO
#2169
// #2169
Object
finalInputParam
=
calculateContextValue
(
paramType
,
execParamEntities
,
currTaskNodeDefEntity
,
currNodeObjectBinding
,
bindNodeDefInfoEntity
);
...
...
@@ -1035,8 +1035,9 @@ public class PluginInvocationService extends AbstractPluginInvocationService {
TaskNodeDefInfoEntity
currTaskNodeDefEntity
,
ProcExecBindingEntity
currNodeObjectBinding
,
TaskNodeDefInfoEntity
bindNodeDefInfoEntity
)
{
// TODO
List
<
Object
>
retDataValues
=
parseDataValueFromContext
(
execParamEntities
);
// TODO #2169
List
<
Object
>
retDataValues
=
parseDataValueFromContext
(
paramType
,
execParamEntities
,
currTaskNodeDefEntity
,
currNodeObjectBinding
,
bindNodeDefInfoEntity
);
if
(
retDataValues
==
null
||
retDataValues
.
isEmpty
())
{
return
null
;
}
...
...
@@ -1052,6 +1053,49 @@ public class PluginInvocationService extends AbstractPluginInvocationService {
}
}
// #2169
private
List
<
Object
>
parseDataValueFromContext
(
String
paramType
,
List
<
TaskNodeExecParamEntity
>
execParamEntities
,
TaskNodeDefInfoEntity
currTaskNodeDefEntity
,
ProcExecBindingEntity
currNodeObjectBinding
,
TaskNodeDefInfoEntity
bindNodeDefInfoEntity
)
{
List
<
Object
>
retDataValues
=
new
ArrayList
<>();
if
(
execParamEntities
==
null
)
{
return
retDataValues
;
}
String
currTaskNodeRoutineExp
=
currTaskNodeDefEntity
.
getRoutineExp
();
String
bindTaskNodeRoutineExp
=
bindNodeDefInfoEntity
.
getRoutineExp
();
String
currFullEntityDataId
=
currNodeObjectBinding
.
getFullEntityDataId
();
for
(
TaskNodeExecParamEntity
e
:
execParamEntities
)
{
String
lastFullEntityDataId
=
e
.
getFullEntityDataId
();
if
(!
checkIfNeedPickoutFromContext
(
currTaskNodeRoutineExp
,
bindTaskNodeRoutineExp
,
currFullEntityDataId
,
lastFullEntityDataId
))
{
continue
;
}
String
paramDataValue
=
e
.
getParamDataValue
();
if
(
e
.
getIsSensitive
()
!=
null
&&
e
.
getIsSensitive
()
==
true
)
{
paramDataValue
=
tryDecodeParamDataValue
(
paramDataValue
);
}
retDataValues
.
add
(
fromString
(
e
.
getParamDataValue
(),
e
.
getParamDataType
()));
}
return
retDataValues
;
}
private
boolean
checkIfNeedPickoutFromContext
(
String
currTaskNodeRoutineExp
,
String
bindTaskNodeRoutineExp
,
String
currFullEntityDataId
,
String
lastFullEntityDataId
)
{
log
.
debug
(
"to calculate currTaskNodeRoutineExp={} {}, bindTaskNodeRoutineExp={}, currFullEntityDataId={}, lastFullEntityDataId={}"
,
currTaskNodeRoutineExp
,
bindTaskNodeRoutineExp
,
currFullEntityDataId
,
lastFullEntityDataId
);
// TODO
return
true
;
}
private
void
handleSystemMapping
(
String
mappingType
,
PluginConfigInterfaceParameters
param
,
String
paramName
,
List
<
Object
>
objectVals
)
{
if
(
MAPPING_TYPE_SYSTEM_VARIABLE
.
equals
(
mappingType
))
{
...
...
@@ -1109,24 +1153,6 @@ public class PluginInvocationService extends AbstractPluginInvocationService {
}
}
// TODO #2169
private
List
<
Object
>
parseDataValueFromContext
(
List
<
TaskNodeExecParamEntity
>
execParamEntities
)
{
List
<
Object
>
retDataValues
=
new
ArrayList
<>();
if
(
execParamEntities
==
null
)
{
return
retDataValues
;
}
for
(
TaskNodeExecParamEntity
e
:
execParamEntities
)
{
String
paramDataValue
=
e
.
getParamDataValue
();
if
(
e
.
getIsSensitive
()
!=
null
&&
e
.
getIsSensitive
()
==
true
)
{
paramDataValue
=
tryDecodeParamDataValue
(
paramDataValue
);
}
retDataValues
.
add
(
fromString
(
e
.
getParamDataValue
(),
e
.
getParamDataType
()));
}
return
retDataValues
;
}
private
PluginConfigInterfaces
retrievePluginConfigInterface
(
TaskNodeDefInfoEntity
taskNodeDefEntity
,
String
nodeId
)
{
String
serviceId
=
retrieveServiceId
(
taskNodeDefEntity
,
nodeId
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help