⌂ Catalog
⇦
Previous section 06 - Role and authority settings
⇨
Next section 08 - WebService
bambooBSC expression.
我想也不會有人想看吧,所以直接用中文寫好了。
注意: 錯誤的 expression 都有可能造成系統崩潰,所以必須要有良好的經驗,在來使用這個功能
有時後有些不是很複雜的需求,但是每個使用方所要的方法又不一樣。 或是沒有一定規則的需求,這些特別的需要如果寫成JAVA code 在 LogicService 中,會照成要常常改code又要重新包版( package WAR )與佈署( re-deploy ),非常的不方便,所以才會有這個功能來輔助 Logic Service。
You must first understand the following framework
使用 02 - Expression
去創建一個expression,這個 expression 必須能與被輔助的 Service Logic bean's method 配合
創建設定
設定 Logic service method 被執行前 / 後 ,執行 expression
以上步驟設定完後,每次被設的的 LogicService method 觸發時,AOP ( ServiceScriptExpressionProcessAspect ) 都會去調用執行設定的 Expression
Name | return | description |
---|---|---|
needProcess(String beanId, String methodName, String system) | boolean | true this LogicService method need expression |
processBefore(String beanId, Method method, String system, ProceedingJoinPoint pjp) | void | before process expression with ServiceLogic method |
processAfter(String beanId, Method method, String system, Object resultObj, ProceedingJoinPoint pjp) | void | after process expression with ServiceLogic method |
Name | return | description |
---|---|---|
execute(String type, String scriptExpression, Map<String, Object> results, Map<String, Object> parameters) |
Map<String, Object> |
run expression, type has BSH, GROOVY, PYTHON |
executeBsh(String scriptExpression, Map<String, Object> results, Map<String, Object> parameters) |
void | run BSH expression |
executeGroovy(String scriptExpression, Map<String, Object> results, Map<String, Object> parameters) |
void | run GROOVY expression |
executeJython(String scriptExpression, Map<String, Object> results, Map<String, Object> parameters) |
void | run JYTHON expression |