서버 측 스크립트 사용 사례

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 29분
  • 서버 측 스크립트의 사용 사례에는 출력 로깅, 사용자 객체 가져오기 및 날짜/시간 값 수정이 포함됩니다.

    비즈니스 규칙에서 워크플로우 스크래치패드에 액세스

    카탈로그 항목이 요청되었으며, 첨부된 워크플로우에 스크래치패드의 값을 채우는 스크립트 실행 활동이 포함되어 있습니다. 요청된 항목에 대해 실행되는 비즈니스 규칙에서 스크래치패드 값을 검색하거나 설정하려고 합니다.

    필수 구성요소

    필요한 역할: admin.

    이름: 비즈니스 규칙에서 워크플로우 스크래치패드에 액세스합니다.

    유형: 비즈니스 규칙

    테이블: sc_req_item(요청된 항목)

    설명: 카탈로그 항목이 요청되었습니다. 첨부된 워크플로우에는 스크래치패드의 값을 채우는 스크립트 실행 활동이 포함되어 있습니다. 요청된 항목에 대해 실행되는 비즈니스 규칙에서 스크래치패드 값을 검색하거나 설정하려고 합니다.

    매개변수: 해당 사항 없음.

    스크립트:
    //the run script activity sets a value in the scratchpad
    workflow.scratchpad.important_msg = "scratch me";
     
    //get the workflow script include helper 
    var workflow = new Workflow();
     
    //get the requested items workflow context 
    //this will get all contexts so you will need to get the proper one if you have multiple workflows for a record 
    var context = workflow.getContexts(current); 
    //make sure we have a valid context 
    if (context.next()) { 
      //get a value from the scratchpad 
      var msg = context.scratchpad.important_msg; 
      //msg now equals "scratch me", that was set in the run script activity
     
      //add or modify a scratchpad value
      context.scratchpad.status = "completed"; 
      //we need to save the context record to save the scratchpad
      context.update(); 
    }

    제공 계획 작업에 따라 그룹에 카탈로그 항목 할당

    데스크톱 그룹에 할당된 카탈로그 작업이 있는 배달 계획을 사용하는 경우 데이터베이스 그룹에 서비스 카탈로그 항목을 할당합니다.

    필수 조건

    필요한 역할: 관리자

    경고:
    여기에 설명된 커스터마이제이션은 특정 인스턴스에서 사용하기 위해 개발되었으며 에서 지원되지 Now Support않습니다. 이 메서드는 있는 그대로 제공되며 구현하기 전에 철저하게 테스트해야 합니다. 이 커스터마이제이션에 대한 모든 질문과 의견을 커뮤니티 포럼에 게시하십시오.

    이름: 제공 계획 작업을 기반으로 그룹에 카탈로그 항목을 할당합니다.

    유형: 할당 규칙

    설명: 이 할당 규칙은 데스크톱 그룹에 할당된 카탈로그 작업이 있는 제공 계획을 사용하는 경우 데이터베이스 그룹에 서비스 카탈로그 항목을 할당합니다.

    스크립트:

    //Return catalog items that have no group but do have a delivery plan assigned var ri  = new GlideRecord ( "sc_cat_item" ) ;
    ri.addQuery("group", "=", null);
    ri.addQuery("delivery_plan", "!=", null);
    ri.query(); 
    while(ri.next()) {
        gs.log("Found an item"); 
        //Return tasks that point to the same delivery plan as the above item 
        var dptask = new GlideRecord("sc_cat_item_delivery_task");
        dptask.addQuery("delivery_plan", "=", ri. delivery_plan);
        dptask.query(); 
        while(dptask.next()) {
            gs.log("Found a task");
            var gp = dptask.group.getDisplayValue();
            gs.log(gp); 
            //If the task is assigned to desktop, assign the item's group to desktop
            if (dptask.group.getDisplayValue() == "Desktop") {
                ri.group.setDisplayValue("Desktop");
                gs.log("updating " + ri.getDisplayValue());
                ri.update(); 
                break; } } }

    기간 계산 중

    작업 또는 프로세스의 기한을 사용자에게 지정하는 방법을 제공해야 하는 경우가 많습니다. DurationCalculator 스크립트 포함을 사용하면 단순 기간 또는 상대 기간을 사용하여 기한을 계산할 수 있습니다.

    일반적으로 기한을 설정하려면 총 시간이 아닌 작업 시간을 계산해야 합니다. 기한을 결정할 때는 작업이 수행되는 해당 일의 시간대만 고려됩니다. 예를 들어 마감 시간이 10시간이지만 영업일 일정으로 제한되어 있는 작업을 예로 들어 보겠습니다. 작업이 월요일 오전 10시에 시작되는 경우 아래 계산에 따라 화요일 오후 12시에 마감됩니다.
    10am-5pm on Monday (6 hours) + 8am-12pm on Tuesday (4 hours)

    DurationCalculator 메서드에 대한 입력으로 사용할 수 있는 일정에 대한 자세한 내용은 일정 만들기 및 사용을 참조하십시오.

    이 스크립트는 DurationCalculator를 사용하여 기한을 계산하는 방법을 보여줍니다.

    /**
     * Demonstrate the use of DurationCalculator to compute a due date.
     * 
     * You must have a start date and a duration. Then you can compute a
     * due date using the constraints of a schedule.
     */
     
    gs.include('DurationCalculator');
    executeSample();
     
    /**
     * Function to house the sample script.
     */function executeSample(){
     
        // First we need a DurationCalculator object.var dc =new DurationCalculator();
     
        // --------------- No schedule examples ------------------
     
        // Simple computation of a due date without using a schedule. Seconds// are added to the start date continuously to get to a due date.
        dc.setStartDateTime("5/1/2012");if(!dc.calcDuration(2*24*3600)){// 2 days
        	gs.log("*** Error calculating duration");return;}
        gs.log("calcDuration no schedule: "+ dc.getEndDateTime());// "2012-05-03 00:00:00" two days later
     
        // Start in the middle of the night (2:00 am) and compute a due date 1 hour in the future// Without a schedule this yields 3:00 am.
        dc.setStartDateTime("5/3/2012 02:00:00");if(!dc.calcDuration(3600)){
            gs.log("*** Error calculating duration");return;}
        gs.log("Middle of night + 1 hour (no schedule): "+ dc.getEndDateTime());// No scheduled start date, just add 1 hour
     
     
        // -------------- Add a schedule to the date calculator ---------------------
        addSchedule(dc);
     
        // Start in the middle of the night and compute a due date 1 hour in the future.// Since we start at 2:00 am the computation adds the 1 hour from the start// of the day, 8:00am to get to 9:00am
        dc.setStartDateTime("5/3/2012 02:00:00");if(!dc.calcDuration(3600)){// 
            gs.log("*** Error calculating duration");return;}
        gs.log("Middle of night + 1 hour (with 8-5 schedule): "+ dc.getEndDateTime());// 9:00 am
     
        // Start in the afternoon and add hours beyond quiting time. Our schedule says the work day// ends at 5:00pm, if the duration extends beyond that, we roll over to the next work day.// In this example we are adding 4 hours to 3:00pm which gives us 10:00 am the next day.
        dc.setStartDateTime("5/3/2012 15:00:00");if(!dc.calcDuration(4*3600)){// 
            gs.log("*** Error calculating duration");return;}
        gs.log("Afternoon + 4 hour (with 8-5 schedule): "+ dc.getEndDateTime());// 10:00 am.
     
        // This is a demo of adding 2 hours repeatedly and examine the result. This// is a good way to visualize the result of a due date calculation.
        dc.setStartDateTime("5/3/2012 15:00:00");// for(var i=2; i<24; i+=1){if(!dc.calcDuration(i*3600)){// 
                gs.log("*** Error calculating duration");return;}
            gs.log("add "+ i +" hours gives due date: "+ dc.getEndDateTime());}
     
        // Setting the timezone causes the schedule to be interpreted in the specified timezone.// Run the same code as above with different timezone. Note that the 8 to 5 workday is// offset by the two hours as specified in our timezone.
        dc.setTimeZone("GMT-2");
        dc.setStartDateTime("5/3/2012 15:00:00");for(var i=2; i<24; i+=1){if(!dc.calcDuration(i*3600)){// 
                gs.log("*** Error calculating duration");return;}
            gs.log("add "+ i +" hours gives due date (GMT-2): "+ dc.getEndDateTime());}}
     
    /** 
     * Add a specific schedule to the DurationCalculator object.
     *  
     * @param durationCalculator An instance of DurationCalculator
     */function addSchedule(durationCalculator){//  Load the "8-5 weekdays excluding holidays" schedule into our duration calculator.var scheduleName ="8-5 weekdays excluding holidays";var grSched =new GlideRecord('cmn_schedule');
        grSched.addQuery('name', scheduleName);
        grSched.query();if(!grSched.next()){
            gs.log('*** Could not find schedule "'+ scheduleName +'"');return;}
        durationCalculator.setSchedule(grSched.getUniqueValue(),"GMT");}

    단순 기간 대 상대 기간

    작업을 완료하는 데 필요한 작업량은 "상대적 기간"으로 표현할 수 있습니다.

    상대 기간은 시작 시간을 기준으로 예상되는 기한 및 시간을 결정합니다. 상대 기간의 예로는 "다음 영업일 오후 4시까지" 또는 "영업일 기준 2일 오전 10시 30분까지"가 있습니다.

    상대 기간을 계산하려면 달력과 시간대를 고려하여 "다음 영업일"의 의미를 결정해야 합니다. 달력은 유효한 근무일이 되는 날을 정의하고 시간대도 결과에 영향을 미치기 때문입니다. 예를 들어, "다음 영업일 오후 4시까지"를 고려하십시오.
    • 월요일 오후 12시인 경우: 다음 영업일 오후 4시까지 = > 화요일 오후 4시
    • 금요일 오후 2시인 경우: 다음 영업일 오후 4시까지 = 다음 월요일 오후 4시>
    주:
    다음 영업일은 일반적으로 시작 날짜 및 시간으로 정의됩니다. 예를 들어 "오후 2시 이전인 경우 다음 영업일 오후 4시"는 현재 시간이 영업일 오후 2시 이후인 경우 "다음 영업일"은 오늘부터 영업일 기준 2일이 계산되지 않음을 의미합니다.

    상대 기간에 대한 자세한 내용은 다음 문서를 참조하십시오 Define a relative duration.

    단순 기간 계산

    이 비즈니스 규칙 및 스크립트 예제는 단순 기간을 계산하는 방법을 보여 줍니다.

    var dur =new DurationCalculator();
    dur.setSchedule(current.schedule);
    dur.setStartDateTime("");
     
    if(current.duration_type==""){
             dur.calcDuration(current.duration.getGlideObject().getNumericValue()/1000);}else{
             dur.calcRelativeDuration(current.duration_type);}
     
        current.end_date_time= dur.getEndDateTime();
        current.work_seconds= dur.getSeconds();

    이 스크립트는 DurationCalculator를 사용하여 단순 기간을 계산하는 방법을 보여줍니다.

    /**
     * Sample script demonstrating use of DurationCalculator to compute simple durations
     * 
     */
     
    gs.include('DurationCalculator');
    executeSample();
     
    /**
     * Function to house the sample script.
     */
    function executeSample(){
     
        // First we need a DurationCalculator object.
        var dc =new DurationCalculator();
     
        // Compute a simple duration without any schedule. The arguments
        // can also be of type GlideDateTime, such as fields from a GlideRecord.
        var dur = dc.calcScheduleDuration("5/1/2012","5/2/2012");
        gs.log("calcScheduleDuration no schedule: "+ dur);
        // 86400 seconds (24 hours)
     
        // The above sample is useful in limited cases. We almost always want to 
        // use some schedule in a duration computation, let's load a schedule.
        addSchedule(dc);
     
        // Compute a duration using the schedule. The schedule
        // specifies a nine hour work day. The output of this is 32400 seconds, or
        // a nine hour span.
        dur = dc.calcScheduleDuration("5/23/2012 12:00","5/24/2012 12:00");
        gs.log("calcScheduleDuration with schedule: "+ dur);
        // 32400 seconds (9 hours)
     
        // Compute a duration that spans a weekend and holiday. Even though this
        // spans three days, it only spans 9 work hours based on the schedule.
        dur = dc.calcScheduleDuration("5/25/2012 12:00","5/29/2012 12:00");
        gs.log("calcScheduleDuration with schedule spaning holiday: "+ dur);
        // 32400 seconds (9 hours)
     
        // Use the current date time in a calculation. The output of this is
        // dependent on when you run it.
        var now =new Date();
        dur = dc.calcScheduleDuration("5/15/2012",new GlideDateTime());
        gs.log("calcScheduleDuration with schedule to now: "+ dur);
        // Different on every run.}
     
    /** 
     * Add a specific schedule to the DurationCalculator object.
     *  
     * @param durationCalculator An instance of DurationCalculator
     */
    function addSchedule(durationCalculator){
       //  Load the "8-5 weekdays excluding holidays" schedule into our duration calculator.
       var scheduleName ="8-5 weekdays excluding holidays";
       var grSched =new GlideRecord('cmn_schedule');
       grSched.addQuery('name', scheduleName);
       grSched.query();if(!grSched.next()){
            gs.log('*** Could not find schedule "'+ scheduleName +'"');
            return;}
        durationCalculator.setSchedule(grSched.getUniqueValue());}

    상대 기간 계산

    상대 기간 계산 스크립트의 예입니다.

    이 스크립트는 "오전 10시 이후인 경우 다음 날 오후 4시"의 상대 기간을 계산합니다.
    // Next day at 4pm if before 10am
    var days =1;
    if(calculator.isAfter(calculator.startDateTime,"10:00:00")) 
          days++;
     
    calculator.calcRelativeDueDate(calculator.startDateTime, days,"16:00:00");

    이 스크립트는 DurationCalculator를 사용하여 상대 기간을 계산하는 방법을 보여줍니다.

    /**
     * Sample use of relative duration calculation.
     * 
     */
     
    gs.include('DurationCalculator');
    executeSample();
     
    /**
     * Function to house the sample script.
     */
    function executeSample(){
     
        // First we need a DurationCalculator object. We will also use
        // the out-of-box relative duration "2 bus days by 4pm"
        var dc =new DurationCalculator();
        var relDur ="3bf802c20a0a0b52008e2859cd8abcf2";
        // 2 bus days by 4pm if before 10am
        addSchedule(dc);
     
        // Since our start date is before 10:00am our result is two days from
        // now at 4:00pm.
        dc.setStartDateTime("5/1/2012 09:00:00");
        if(!dc.calcRelativeDuration(relDur)){
            gs.log("*** calcRelativeDuration failed");
            return;}
        gs.log("Two days later 4:00pm: "+ dc.getEndDateTime());
     
        // Since our start date is after 10:00am our result is three days from
        // now at 4:00pm.
        dc.setStartDateTime("5/1/2012 11:00:00");
        if(!dc.calcRelativeDuration(relDur)){
            gs.log("*** calcRelativeDuration failed");
            return;}
        gs.log("Three days later 4:00pm: "+ dc.getEndDateTime());}
     
    /** 
     * Add a specific schedule to the DurationCalculator object.
     *  
     * @param durationCalculator An instance of DurationCalculator
     */
    function addSchedule(durationCalculator){
      //  Load the "8-5 weekdays excluding holidays" schedule into our duration calculator.
      var scheduleName ="8-5 weekdays excluding holidays";
      var grSched =new GlideRecord('cmn_schedule');
      grSched.addQuery('name', scheduleName);
      grSched.query();
      if(!grSched.next()){
            gs.log('*** Could not find schedule "'+ scheduleName +'"');
            return;}
      durationCalculator.setSchedule(grSched.getUniqueValue(),"GMT");}

    상대 기간을 구현하는 방법

    cmn_relative_duration 테이블과 DurationCalculator 스크립트 포함을 만들어 상대 기간을 구현할 수 있습니다.

    시작하기 전에

    필요한 역할: 관리자

    프로시저

    1. cmn_relative_duration 테이블을 생성합니다.
    2. DurationCalculator 스크립트 포함을 생성합니다.
    3. 샘플 상대 기간 항목을 생성합니다(예: "다음 영업일 오후 4시까지").
    4. 상대 기간을 지원하기 위해 필요한 필드를 SLA 테이블에 추가합니다.
    5. SLA에 대한 기간 계산을 수정합니다.
    6. SLA에 대한 SLA 백분율 타이머 계산을 수정합니다(이 경우 work_seconds 사용해야 합니다).
    7. 워크플로우: 일정 및 시간대에 일정 필드를 추가합니다(워크플로우 테이블의 필드를 기준으로 선택됨).
    8. 워크플로우 작업 활동에 기간 지원 필드를 추가합니다.
    9. 작업 활동에 대한 기간 계산 스크립트를 구현합니다.

    상대 기간 테이블 및 DurationCalculator 메서드

    cmn_relative_duration 테이블은 기한을 기간 또는 상대적 기간으로 정의할 수 있도록 지원합니다.

    이 테이블은 "이름"과 "스크립트"의 두 필드로 구성됩니다. "스크립트" 필드에는 상대 기간 계산 스크립트가 포함되어 있습니다. 이 스크립트에는 기한을 계산하는 데 사용되는 "계산기" 변수가 포함되어 있습니다.

    DurationCalculator 스크립트 포함을 사용하여 기간 계산을 수행할 수 있습니다. 다음은 이 스크립트 포함에서 사용할 수 있는 메서드입니다.

    표 1. DurationCalculator 스크립트 포함 테이블
    방법 설명
    setSchedule(문자열 schedID, [문자열 시간대]) 기한을 계산하는 데 사용할 일정과 시간대를 설정합니다.
    setStartDateTime(GlideDateTime 시작) 기간 계산의 시작 시간을 설정합니다. "시작"이 비어 있으면 현재 날짜/시간을 사용합니다.
    calcDuration(int 초) 종료 날짜 및 시간을 계산합니다. 완료되면 this.endDateTime 및 this.seconds 속성이 계산 결과를 나타내도록 설정됩니다.
    calcRelativeDuration(문자열 relativeDurationID) 지정된 상대 기간 스크립트를 사용하여 기간을 계산합니다. 완료되면 this.endDateTime 및 this.seconds 속성이 계산 결과를 나타내도록 설정됩니다.
    getEndDateTime() 기간의 종료 날짜 및 시간을 나타내는 calcDuration/calcRelativeDuration으로 설정된 this.endDateTime 속성을 가져옵니다.
    getSeconds() 해당 기간 동안 수행할 작업의 총 시간(초)을 나타내는 calcDuration/calcRelativeDuration에 의해 설정된 this.seconds 속성을 가져옵니다.
    주:
    이 값은 시작 시간과 종료 시간 사이의 총 시간이 아니라 총 작업 시간이며 작업 시간의 백분율을 결정하는 데 사용될 수 있습니다.
    getTotalSeconds() 기간의 시작 시간과 종료 시간 사이의 총 시간(초)을 나타내는 calcDuration/calcRelativeDuration으로 설정된 this.totalSeconds 속성을 가져옵니다.

    상대 기간 스크립트에는 다음 함수가 사용됩니다.

    표 2. 상대 기간 스크립트 함수
    함수 설명
    부울 isAfter(GlideDateTime dt, 문자열 시간) "시간"은 "dt"로 지정된 시간 이후입니까? DT가 비어 있는 경우 현재 날짜/시간을 사용합니다. 시간은 24시간 형식의 "hh:mm:ss"입니다.
    calcRelativeDueDate(GlideDateTime start, int days, String endTime) "시작"에서 시작하여 일정과 시간대를 사용하여 "일"을 더하는 기한을 계산합니다. 작업 예정일을 찾으면 시간을 해당 날의 'endTime'으로 설정합니다. 완료되면 this.endDateTime 및 this.seconds 속성이 계산 결과를 나타내도록 설정됩니다. endTime이 비어 있으면 종료 근무일의 끝을 사용합니다.

    사용자 객체 가져오기

    비즈니스 규칙 또는 기타 서버 스크립트에서 gs.getUser() 메서드는 사용자 객체를 반환합니다. 사용자 객체는 현재 로그인한 사용자의 내부 표현이며 사용자 및 다양한 유틸리티 기능에 대한 정보를 제공합니다.

    이 태스크 정보

    사용자 객체에 사용 가능한 범위가 지정된 메서드의 목록 및 설명은 GlideUser 문서를 참조하십시오.

    프로시저

    1. 현재 사용자를 검색합니다.
      var myUserObject = gs.getUser()
    2. getUserByID 메서드를 사용하여 대상 기록의 user_name 필드 또는 sys_id 사용하여 다른 사용자를 가져옵니다.
      예:
      var ourUser = gs.getUser(); 
      gs.print(ourUser.getFirstName()); //print the first name of the user you are currently logged in as 
      newUser = ourUser.getUserByID(<user_sys_id>); //fetch a different user, using the sys_id of the target user record. 
      gs.print(newUser.getFirstName()); //first name of the user you fetched above 
      gs.print(newUser.isMemberOf('Capacity Mgmt'));

    로그 출력

    GSLog 는 호출자별로 식별된 sys_properties 값으로 선택할 수 있는 로그 출력 수준을 구현하여 스크립트 로깅 및 디버깅을 간소화하는 스크립트 포함입니다.

    로그 수준

    로그는 디버그, 정보, 알림, 경고, 오류 또는 치명타(BSD syslog.h 및 팔로워 이후) 수준일 수 있습니다. 기본 로깅 수준은 알림이므로 그에 따라 수준을 선택해야 합니다.

    사용 장소

    이벤트 로깅을 구현하려는 서버 측 스크립트에 사용합니다.

    API 참조는 GSLog()를 참조하세요.

    자세한 내용은 디버깅 스크립트를 참조하십시오

    GlideDateTime 필드 값 수정

    이 예시에서는 서버 측 스크립트를 사용하여 GlideDateTime 필드 값을 수정하는 방법을 보여줍니다.

    다음 서버 측 스크립트 예시는 GlideDateTime API를 사용하여 값을 수정하는 방법을 보여줍니다. GlideDate 개체에도 동일한 개념이 적용됩니다.
    주:
    다음 스크립트는 전역 애플리케이션에만 사용할 수 있습니다.
    //You first need a GlideDateTime object
    //this can be from instantiating a new object "var gdt = new GlideDateTime()"
    //or getting the object from a GlideDateTime field
    //getting the field value (for example: var gdt = current.start_date) only returns the string value, not the object
    //to get the object use var gdt = current.start_date.getGlideObject(); (GlideElement)
    //now gdt is a GlideDateTime object
    var gdt = current.start_date.getGlideObject();
     
    //All methods can use negative values to subtract intervals
     
    //add 1 hour (60 mins * 60 secs)
    gdt.addSeconds(3600);
     
    //add 1 day
    gdt.addDaysLocalTime(1);
     
    //subtract 1 day
    gdt.addDaysLocalTime(-1);
     
    //add 3 weeks
    gdt.addWeeksLocalTime(3);
     
    //subtract 6 months
    gdt.addMonthsLocalTime(-6);
     
    //add 1 year, representing the date and time using the UTC timezone instead of the local user's timezone.
    gdt.addYearsUTC(1);
     
    //set the value of the GlideDateTime object to the current session timezone/format
    GlideSession.get().setTimeZoneName('US/Eastern');
    gdt.setDisplayValue('2018-2-28 00:00:00');
    gs.info('In ' + GlideSession.get().getTimeZoneName() + ": " + gdt.getDisplayValue());
    참조 :

    사용자 지정 큐를 사용하여 이벤트 처리

    대량의 이벤트를 생성하거나 처리하는 데 시간이 오래 걸리는 이벤트에 대해 사용자 지정 큐를 사용할 수 있습니다. 이 작업은 사용자 지정 큐, 모니터링 프로세스를 만들고 스크립트를 사용하여 큐로 이벤트를 보내는 방법을 보여줍니다.

    시작하기 전에

    필요한 역할: 관리자

    주:
    이 정보는 이벤트 처리에 익숙한 고급 사용자를 위한 것입니다.

    프로시저

    1. 다음으로 이동 시스템 정책 > 이벤트 > 레지스트리.
    2. 사용자 지정 큐를 생성할 이벤트를 선택합니다.
      이벤트 등록 양식이 표시됩니다.
    3. 이벤트 레지스트리에서 이벤트의 큐 필드를 채웁니다.
      소문자만 사용하고 공백을 사용하지 않으며 밑줄(_)을 제외한 특수 문자는 사용하지 마십시오.
    4. 제출을 클릭합니다.
      이벤트 [sysevent] 테이블에 새 이벤트가 나열됩니다.

      다음 예시에서는 employeeOccasion 이벤트가 생성되면 이벤트가 my_queue에 추가됩니다. 이벤트가 큐에서 멈췄습니다. 이 문제를 해결하려면 이벤트를 큐에서 감시하는 프로세스를 생성합니다.큐 필드에 추가된 큐가 나열된 이벤트를 나열하는 이벤트 테이블입니다.

    5. 다음으로 이동 시스템 스케줄러 > 예약된 작업 > 예약된 작업 을 클릭하고 텍스트 인덱스 이벤트 프로세스라는 예약된 작업을 엽니다.
      이름 검색 필드에 *text가 있고 텍스트 인덱스 이벤트의 이름이 강조 표시된 일정 테이블 프로세스 일정입니다.
    6. 추가 작업 메뉴 아이콘 추가 작업 아이콘 메뉴)-->를 누르고 삽입 및 유지 를 선택하여 텍스트 인덱스 이벤트 프로세스의 복사본을 만듭니다.
      중요사항:
      작업을 복사하고 텍스트 인덱스 이벤트 프로세스 예약된 작업을 덮어쓰지 않아야 합니다.
    7. 복사한 일정 항목에서 이름 필드의 값을 변경합니다.
    8. 작업 컨텍스트 필드에서 GlideEventManager() 매개변수의 값을 새 큐의 이름으로 바꿉니다.
      작업 컨텍스트 필드에 GlideEventManager의 복사된 항목의 이름이 변경되고 업데이트된 큐 이름을 보여주는 일정 항목 양식입니다.
      큐 모니터링 프로세스는 예시 my_queue 이벤트 큐에서 이벤트를 찾고 처리합니다.

      처리됨 및 큐 필드의 내용을 강조 표시하는 이벤트 테이블입니다.

    9. gs.eventQueue() 메서드의 다섯 번째 매개변수를 사용하여 이벤트를 사용자 지정 큐로 보냅니다.

      다음 코드는 my_queue 사용자 지정 큐에 이벤트를 보내는 방법을 보여 줍니다.

      gs.eventQueue('x_60157_employee_spe.employeeOccasion', todaysOccasions, todaysOccasions.number, todaysOccasions.u_employee.name, 'my_queue');
      주:
      이벤트가 이벤트 레지스트리 에 있고 gs.eventQueue에 큐 이름이 제공되지 않은 경우 이벤트 레지스트리 의 큐는 여전히 이벤트에 할당됩니다. 예를 들어 gs.eventQueue('x_60157_employee_spe.employeeOccasion') 는 여전히 이벤트를 my_queue와 연결합니다. gs.eventQueue() 호출에 큐 이름이 제공되면 큐가 우선합니다.
      이벤트 [sysevent] 테이블을 확인하여 호출된 이벤트가 처리되었는지 확인할 수 있습니다.