세션 템플릿을 기반으로 세션을 만들고 세션의 고유 식별자를 반환합니다.
Syntax
Microsoft.Apm.createSession(SessionInput);
매개 변수
| 이름 | 유형 | 필수 | Description |
|---|---|---|---|
| 세션입력 | String | Yes | 생성할 세션의 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});