@Component public class GlueInitParamActivity extends GlueActivity<GlueContext>
- param-count : (필수) param 개수 - param# : (선택) key::value 형태. value는 java.lang.String 으로 초기화함. - override : (선택) ctx에 key가 존재할 경우 value로 값을 변경할지 여부, default true.다음은 activity 사용 예시입니다.
<activity name="지불Command 생성" class="com.poscoict.glueframework.biz.activity.GlueInitParamActivity">
<transition name="success" value="지불서비스 호출" />
<property name="param-count" value="1" />
<property name="param1" value="command::pay" />
</activity>
<activity name="지불취소Command 생성" class="com.poscoict.glueframework.biz.activity.GlueInitParamActivity">
<transition name="success" value="지불서비스 호출" />
<property name="param-count" value="1" />
<property name="param1" value="command::refund" />
<property name="override" value="true" />
</activity>
다음은 테스트 코드 일부입니다.
@Bean public CommandLineRunner run( GlueInitParamActivity activity ) { return ( args -> { String uri = "http://localhost:8080/dept"; Mapprops = new HashMap<>(); props.put( "param-count", "1" ); props.put( "param1", "command::pay" ); GlueDefaultContext ctx = new GlueDefaultContext( "no-service" ); ctx.setActivityProperties( GlueInitParamActivity.class, props ); ctx.put( "command", "not ready" ); activity.runActivity( ctx ); System.out.println( ctx.get( "command" ) ); } ); }
Modifier and Type | Field and Description |
---|---|
protected static String |
OVERRIDE
property : override
|
protected static String |
PARAM_COUNT
property : param-count
|
applicationContext, FAILURE, logger, RESULT_KEY, RESULT_KEY_POSTFIX, SUCCESS
Constructor and Description |
---|
GlueInitParamActivity() |
Modifier and Type | Method and Description |
---|---|
String |
runActivity(GlueContext ctx)
abstract method.
|
checkMethodName, destroy, getMethod, getParamCount, getRequiredType, getResultKey, init, makeMethodParamTypes
protected static final String PARAM_COUNT
protected static final String OVERRIDE
public String runActivity(GlueContext ctx)
GlueActivity
runActivity
in class GlueActivity<GlueContext>
Copyright © 2019 POSCOICT. All rights reserved.