コンテンツエリア開始

Function documentation ビジネスイベントのキャプチャ  Locate the document in its SAP Library structure

用途

この機能を使用すると、ビジネスイベントをキャプチャすることができます。言い換えると、この機能を使用して、BusinessEventHandler を設定することができます。ビジネスイベントを有効化するには、2 つの方法があります。以下のビジネスハンドラへの参照のどちらかを使用することができます。

     IsaBaseAction

通常は、IsaBaseAction 内のイベントを使用する必要があります。コーディングは以下のような構文になります。

Syntax

public class ZEventAction extends ISACoreBaseAction {

public ActionForward isaPerform(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response,

UserSessionData userSessionData,

RequestParser requestParser,

BusinessObjectManager bom,

IsaLocation log,

IsaCoreInitAction.StartupParameter startupParameter,

BusinessEventHandler eventHandler)

throws CommunicationException {

ZObject zObject = bom.getZObject();

if (zObject != null) {

ZEvent event = new ZEvent (zObject);

eventHandler.fireBusinessEvent(event);

}

return mapping.findForward("success");

}

     BusinessObjectBase を拡張したすべてのビジネスオブジェクト

トリガがアクションで発生しない場合、またはイベントがアクション内の複数箇所で発生する場合は、BusinessObjectBase だけを使用します。コーディングは以下のような構文になります。

Syntax

public class ZBusinessObect extends BusinessObjectBase {

public void zMethod() {

if (businessEventHandler != null) {

ZEvent event = new ZEvent (this);

eventHandler.fireBusinessEvent(event);

}

...

}

}

アクティビティ

この例の新規イベントはアクションをベースにしているため、ISACoreBaseAction への参照を使用する必要があります。コーディングは以下のような構文になります。

Syntax

public class CaptureRequestHelpAction extends IsaCoreBaseAction {

public ActionForward isaPerform(ActionMapping mapping,

ActionForm form,

HttpServletRequest request,

HttpServletResponse response,

UserSessionData userSessionData,

RequestParser requestParser,

BusinessObjectManager bom,

IsaLocation log,

IsaCoreInitAction.StartupParameter startupParameter,

BusinessEventHandler eventHandler)

throws CommunicationException {

String helpType;

String helpAction = requestParser.getParameter("action").getValue().getString();

helpType = helpAction.toUpperCase();

RequestHelpEvent event = new RequestHelpEvent(bom.getUser(), bom.getShop(), helpType);

eventHandler.fireBusinessEvent(event);

if (helpAction.equals("email")) {

return mapping.findForward("email");

}

return mapping.findForward("success");

}

}

参照:

イベントの登録

 

コンテンツエリア終了