Menu

Problem with new status added on UserRequest class

2015-05-26
2015-06-04
  • Fotios Kossyvas

    Fotios Kossyvas - 2015-05-26

    I have the following error shown by iTop toolkit:

    Class UserRequest
    
    Unknown function '' in transition [assigned/ev_progress] for state attribute 'status' (Specify a function which prototype is in the form [public function (...){return true;}])
    Unknown function '' in transition [progress/ev_pending] for state attribute 'status' (Specify a function which prototype is in the form [public function (...){return true;}])
    Unknown function '' in transition [progress/ev_resolve] for state attribute 'status' (Specify a function which prototype is in the form [public function (...){return true;}])
    Unknown function '' in transition [progress/ev_autoresolve] for state attribute 'status' (Specify a function which prototype is in the form [public function (...){return true;}])
    

    I have edited the UserRequest by doing this :
    1) added a new value (progress) for the enumerated field named status
    2) added a new <stimulus id="user-content-ev_progress" xsi:type="StimulusUserAction">
    3) added the following code to the <transitions> part of the state <state id="user-content-assigned"></state></transitions></stimulus>

                  <transition id="ev_progress">
                    <target>progress</target>
                    <actions>
                      <action>
                        <verb>SetCurrentDate</verb>
                        <params>
                          <param xsi:type="attcode">progress_date</param>
                        </params>
                      </action>
                    </actions>
                  </transition>
    

    4) Defined the progress state using the following code :

              <state id="progress">
                <inherit_flags_from>assigned</inherit_flags_from>
                <flags/>          
                <transitions>
                  <transition id="ev_pending">
                    <target>pending</target>
                    <actions>
                      <action>
                        <verb>SetCurrentDate</verb>
                        <params>
                          <param xsi:type="attcode">last_pending_date</param>
                        </params>
                      </action>
                    </actions>
                  </transition>
                  <transition id="ev_resolve">
                    <target>resolved</target>
                    <actions>
                      <action>
                        <verb>SetCurrentDate</verb>
                        <params>
                          <param xsi:type="attcode">resolution_date</param>
                        </params>
                      </action>
                      <action>
                        <verb>SetElapsedTime</verb>
                        <params>
                          <param xsi:type="attcode">time_spent</param>
                          <param xsi:type="attcode">start_date</param>
                          <param xsi:type="string">DefaultWorkingTimeComputer</param>
                        </params>
                      </action>
                      <action>
                        <verb>ResolveChildTickets</verb>
                        <params/>
                      </action>
                    </actions>
                  </transition>
                  <transition id="ev_timeout">
                    <target>escalated_ttr</target>
                    <actions/>
                  </transition>
                  <transition id="ev_autoresolve">
                    <target>resolved</target>
                    <actions>
                      <action>
                        <verb>SetCurrentDate</verb>
                        <params>
                          <param xsi:type="attcode">resolution_date</param>
                        </params>
                      </action>
                      <action>
                        <verb>SetElapsedTime</verb>
                        <params>
                          <param xsi:type="attcode">time_spent</param>
                          <param xsi:type="attcode">start_date</param>
                          <param xsi:type="string">DefaultWorkingTimeComputer</param>
                        </params>
                      </action>
                      <action>
                        <verb>ResolveChildTickets</verb>
                        <params/>
                      </action>
                    </actions>
                  </transition>
                </transitions>
              </state>
    

    The progress_date field is a new field already defined in the Ticket class (parent of UserRequest)

    I thought that i had defined everything but i have these errors above and when (of course) i am trying to change the status of a user request from assigned to progress (using the iTop UI) i get "The action has failed."

    Can anyone tell me what i am missing here?
    Thank you

     
  • dlp

    dlp - 2015-06-04

    can you give the complete datamodel? I will try to test it, and see what is wrong.

     
  • Fotios Kossyvas

    Fotios Kossyvas - 2015-06-04

    Thank you being so helpful dlp but finally i resolved my problem!
    As always, trying to explain the problem to another person, many times drives you to the solution of the problem ;-)
    The problem was some _delta="redefine" and _delta="define_if_not_exists" missing, like in

    <stimulus id="ev_progress" xsi:type="StimulusUserAction" _delta="define_if_not_exists" />
    
    and in
    
    <state id="progress" _delta="define_if_not_exists">
    
    and in
    
     <state id="assigned" _delta="redefine"> 
    
     
  • dlp

    dlp - 2015-06-04

    Great!
    Yes the errors logs are not very clear when you put a wrong attribute to delta...

     

    Last edit: dlp 2015-06-04

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.