CA Service Management

 View Only
  • 1.  Attached Event Issue

    Posted Feb 24, 2020 05:56 PM

    We have a requirement that a classic workflow begins once the Status has changed from 'RFC' and not when the ticket is created, which is the default behavior.  I've setup the first task in the workflow, sequence #2 to be a dummy 'Approval' task.

    I've managed to get the Event to attach via SPEL and get an out of the box action to execute.  However I really need some help on what the action macro should look like to change the workflow status from "Pending" to "Approved".  There is a thread in here that seems to discuss it but the screenshot links that I believe have the code are broken.

    I played around with manipulating the upd_val mention from a cr_wf to wf reference but no luck.

    Running version 17.2



    ------------------------------
    Derek
    ------------------------------


  • 2.  RE: Attached Event Issue
    Best Answer

    Posted Feb 25, 2020 04:49 AM
    Hello,

    Here is some action code, that sets task status:

    uuid who;
    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");

    send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "status", "APP");
    if (msg_error()) {
    logf(ERROR,"update_object_super error: %s",msg[0]);
    }


  • 3.  RE: Attached Event Issue

    Posted Feb 25, 2020 01:30 PM
    Thank you Sigitas.  I do get some error messages and the event status goes to unknown without (successfully) executing the action though.  Do these errors mean anything to you?

    02/25 09:55:55.79 ivd-sdm-web1 spelsrvr 7696 ERROR pcexec.c 6503 Spell interp failed at bopevt.spl:1243:atev::compute_next_time | bopevt.spl:1021:atev.wait_time::post_val10: AHD04324:Error on line 1 column 1 of definition. AHD04321:Invalid date specification. Error line:0
    02/25 09:56:05.04 ivd-sdm-web1 spelsrvr 7696 ERROR interp.c 583 __eval__ Code error at line 7 at "" (syntax error)
    02/25 09:56:05.04 ivd-sdm-web1 spelsrvr 7696 ERROR macro.spl 538 __eval__ Code error at line 7 at "" (syntax error)
    02/25 09:56:05.04 ivd-sdm-web1 animator_nxd 11672 ERROR animator_nxd.c 2723 Method 2 failed for event *Start RFC Workflow in animator ANI:403055 (chg:438635) for atev:606358


    My SPEL script is listed below if you venture the issue might be there.  The event finishes and does seem to work just fine if I use another action macro to set workflow task violation for example.

    __________________________

    chg::z_myscript4(...){

    duration timeout;
    timeout = 5;
    object group_leader;
    send_wait(0, top_object(), "get_co_group");
    if (msg_error()) {
    printf("Error'%s'", msg[0]);
    return;
    }
    else{
    group_leader = msg[0];
    send_wait(0, top_object(), "call_attr", "evt", "new_attached_event", group_leader, "chg:438635","*Start RFC Workflow", timeout ,now(), "SLA", 0, 0,"GMT-0800");
    if (msg_error()) {
    printf("Error %s",msg[0]);
    }

    }
    send_wait(0, group_leader, "checkin");
    if (msg_error()) {
    printf("Error'%s'", msg[0]);
    }
    }


  • 4.  RE: Attached Event Issue

    Posted Feb 27, 2020 03:50 AM
    My macro will not work if object type is Change Order. The way I see this customization you need to create event and action macro with object type "Workflow Task". And method z_myscript4 should attach event to task.


  • 5.  RE: Attached Event Issue

    Posted Mar 02, 2020 12:56 PM
    Thank you.  For whatever reason when I attach an event of type Change Order Workflow Task and the events are all associated to this object as well the application tries to process it as a Change Order object.  So when I try to change the status of the workflow task it tries to change the status of the Change Order itself.  Interestingly if I add the exact same action macro to the behavior template of a workflow task it does change the status like I would anticipate.  I'm beginning to think this may be a system bug / limitation.