상태 모델 스크립트 포함 업데이트

  • 릴리스 버전: Zurich
  • 업데이트 날짜 2025년 07월 31일
  • 소요 시간: 2분
  • ChangeRequestStateModel_normal 스크립트 포함을 업데이트하여 완료 상태에 새 함수를 추가합니다.

    시작하기 전에

    필요한 역할: admin

    이 태스크 정보

    ChangeRequestStateModel_normal을 다음 구성으로 업데이트합니다.
    • 완료 상태에 새 canMovemoving 함수를 추가합니다. 이러한 함수는 완료 상태로 이동할 때 수행할 특수 조건이나 추가 작업이 없기 때문에 True 값을 반환할 수 있습니다.
    • 구현 상태에 대한 기존 개체의 정의를 수정하여 다음 상태가 완료인지 확인합니다.
    • 완료 상태에 대한 개체를 추가하면 이 상태가 검토종결을 다음 두 상태로 정의합니다.
      주:
      이러한 완료 상태에서 전환하는 canMove 함수는 검토 필요 사용자 지정 필드를 확인하여 다음 상태를 올바르게 결정합니다.

    프로시저

    1. 다음으로 이동 모두 > 시스템 정의 > 스크립트 포함.
    2. ChangeRequestStateModel_normal 스크립트를 열고 다음과 같이 스크립트를 수정합니다.
      1. 유형으로 시작하는 라인 앞이 아니라 스크립트 포함 끝에 다음 라인을 추가합니다.
        toComplete_moving: function() {
                      return true; 
                 },              
        
                 toComplete_canMove: function() {      
                       return true;       
                 },
        수정된 스크립트
      2. 기존 구현 개체를 수정하여 완료합니다.
        implement: {
                    nextState: [ "complete" ],
        
                    complete: { 
                        moving: function() {                
                            return this.toComplete_moving(); 
                        },             
        
                        canMove: function() {                
                            return this.toComplete_canMove();            
                        }       
                    },        
        
                    canceled: {  
                        moving: function() {               
                           return this.toCanceled_moving();   
                        },             
        
                        canMove: function() {               
                           return this.toCanceled_canMove(); 
                        }        
                    }    
                },
    3. 다음 새 상태 개체를 추가하여 완료합니다.
      complete: {
                   nextState : [ "review", "closed" ],         
      
                   review : {            
                         moving : function() {
                               return this.toReview_moving();            
                         },             
      
                         canMove : function() {              
                                if (this._gr.getValue("u_needs_review") == "Yes")   
                                     return true;                            
                            
                                return false;
                         }        
                   },                     
      
                   closed : {            
                         moving : function() {  
                               return this.toClosed_moving();
                         },             
      
                         canMove : function() {              
                                if (this._gr.getValue("u_needs_review") == "No")
                                     return true;    
                              
                        return false;
                        }       
                   },  
      
                   canceled : { 
                         moving : function() {                
                               return this.toCanceled_moving();     
                         },             
      
                         canMove : function() {                
                                return this.toCanceled_canMove(); 
                         }   
                   }    
              },
    4. 업데이트를 클릭합니다.