次の方法で共有


createSession (アプリ プロファイル マネージャー)

セッションテンプレートに基づいてセッションを作成し、セッションの一意の識別子を返します。

構文

Microsoft.Apm.createSession(SessionInput);

パラメーター

名前 タイプ 必須 Description
セッション入力 String イエス 作成されるセッションの JSON 入力プロパティ。

JSON SessionInput パラメーターの構造は次のとおりです。

{
        /**
         * Returns the name of the template used in the session
         */
        templateName: string;
        /**
         * additional information for session creation
         */
        sessionContext: Map<string, string>;
        /**
         * will focus after session is created
         */
        isFocused?: boolean;
    }

戻り値

セッション識別子を文字列として指定します。

例示

これらの例では、 createSession メソッドを使用して、エンティティ レコード識別子とセッション テンプレートをパラメーターとして渡す新しいセッションを作成します。

基本セッションを作成する

インシデントをエンティティ名として、インシデント ID を entityId として、セッション テンプレートの一意の名前を templateName として渡す新しいセッションを作成します。

これらのメソッドを呼び出すユーザーは、セッション テンプレートを含むアプリ プロファイルに割り当てる必要があります。

x=new Map();
x.set("parametersStr", '[["entityName", "incident"], ["entityId", "11bb11bb-cc22-dd33-ee44-55ff55ff55ff"]]');
Microsoft.Apm.createSession({templateName: "case_entity_session_default_template", sessionContext: x});

フォーカスされていないセッションを作成する

x=new Map(); 
x.set("parametersStr", '[["entityName", "incident"], ["entityId", "22cc22cc-dd33-ee44-ff55-66aa66aa66aa"]]'); 
Microsoft.Apm.createSession({templateName: "case_entity_session_default_template", sessionContext: x, isFocused: false});