הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
יוצר הפעלה המבוססת על תבנית הפעלה ומחזיר את המזהה הייחודי של ההפעלה.
תחביר
Microsoft.Apm.createSession(SessionInput);
פרמטרים
| שם | Type | נדרש | תיאור |
|---|---|---|---|
| קלט הפעלה | 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;
/**
* Indicates whether the session should be restored after creation.
* If set to true, the session is restored in the agent workspace. Else, the session is created without being restored.
*/
shouldRestore?: boolean;
}
ערך החזרה
מזהה הפעלה כמחרוזת.
דוגמאות
דוגמאות אלה משתמשות בשיטה createSession כדי ליצור הפעלה חדשה שמעבירה מזהה רשומת ישות ותבנית הפעלה כפרמטרים.
יצירת הפעלה בסיסית
יוצר הפעלה חדשה שמעבירה את האירוע כשם ישות, מזהה אירוע כ- 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});