CA Service Management

 View Only
  • 1.  How to reopen all workflows when the request status = Reopen?

    Posted Jan 18, 2017 10:51 AM

    Hi, i need to reopen all or a specific workflow task, every time the end user reject the final solution on ticket and change the status of the request from RESOLVED to REOPEN.

    Any idea?

     

    Best regards,

    Fabian



  • 2.  Re: How to reopen all workflows when the request status = Reopen?
    Best Answer

    Posted Jan 18, 2017 11:10 AM

    Add Default Reopened status to the first wf task. Create trigger on chg reopen that will fire the spel code that will change status for the task to reopened. This will put all other tasks in reopen-wait status



  • 3.  Re: How to reopen all workflows when the request status = Reopen?

    Posted Jan 18, 2017 01:02 PM

    Thanks, but that is exactly i need. Can you share the spell code to do that?

     

    thanks. 



  • 4.  Re: How to reopen all workflows when the request status = Reopen?

    Posted Jan 18, 2017 02:32 PM

    I have not tested this code, but i think it should work. Code should work if you will use pre_validate trigger

    not sure what is code in your enviroment, but for example i will use Reopen:

    PRE_VALIDATE zreopen() 4009 FILTER( EVENT("UPDATE") && (status{->'REOPEN'} ));

     

     

    chg::zreopen(...){

    object objList, objectPointer;
    string wc;
    uuid who;


    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
    if (msg_error())
     {
     logf(ERROR, format("AHDConnect: Get co_group '%s'", msg[0]));
     return (-1);
    }

    who=msg[0];

    wc = format("chg = %d", id);

    send_wait(0,top_object(),"call_attr","wf","sync_fetch","MLIST_STATIC", wc,-1,0);
    objList = msg[0];


    if (msg[1]>0)
    {
     send_wait(0, objList, "dob_by_index", "DEFAULT", 0, 0);
      if (msg_error())
      {
       logf(ERROR, format("AHDConnect:dob_by_index '%s'", msg[0]));
       return (-4);
      }
      else
      {
       objectPointer = msg[0];
       send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, objectPointer.persistent_id, 0, "status", "tskstat:7105");
       if (msg_error())
       {
       logf(ERROR, "Update object macro error: '%s'", msg[0]);
       }

      }

    }


    }