To: SO team,

The service task java (actually spring bean) invocation using the expression 
implementation method is as follows, for example:

 

                
${VnfAdapterImpl.preProcessVnfAdapter(InjectExecution.execute(execution, 
execution.getVariable(“gBuildingBlockExecution”)))}

 

The InjectExecution.execute function, basically, gets the first 
DelegateExecution execution and second DelgateExecutionImpl impl parameters, 
sets the execution object into the impl object, and returns the impl object 
because the called function (e.g., VnfAdapterImpl.preProcessVnfAdapter) needs 
the BuildingBlockExecution object parameter. 

 

To me, this InjectExecution.execute method works for BuildingBlockExecution 
only; it is not a general purpose function for injecting any variables. All the 
Building Block Service Task invocations use the “same” second parameter - 
boilerplate.

 

The BuildingBlockExecution is a superset of the Camunda DelegateExecution. The 
BB service tasks do not use the DelegateExpression implementation (which 
injects the Camunda DelegateExecution object implicitly).

The BB service tasks use the Expression implementation for method flexibility 
and for our business need (e.g., for additional fields, seedMap). This method 
works, but passing the same second parameter, which can be extracted from the 
first parameter execution is not convenient. We can simplify by doing:

 

                
${VnfAdapterImpl.preProcessVnfAdapter(InjectExecution.execute(execution, 
execution.getVariable(“gBuildingBlockExecution”)))}
--> 

${VnfAdapterImpl.preProcessVnfAdapter(Inject *BB* 
Execution.execute(execution))}             // we can get the 
BuildinBlockExecution object from the BPMN workflow before calling this, but 
that needs a  script task. Eh…

 

Since the InjectExecution.execute works for BuildingBlockExecution, we can 
rename it to Inject *BB* Execution and extract the gBuildingBlockExecution from 
the first execution parameter, such as:

 

                                @Component

                                Public class InjectBBExecution {

 

Public DelegateExecutionImpl execute (DelegateExecution execution) {

DelegateExecutionImpl impl = (DelegateExecutionImpl) 
execution.getVariable(“gBuildingBlockExecution”);

If (impl != null } {

impl.setDelegateExecution(execution);

                                                                } else {

                                                                                
// error condition

                                                                }

return impl;

}

                                }

If I miss something here, please advise. 

Thanks.
Byung

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11670): https://lists.onap.org/g/onap-discuss/message/11670
Mute This Topic: https://lists.onap.org/mt/24205141/21656
Mute #so: https://lists.onap.org/mk?hashtag=so&subid=2740164
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to