CA Service Management

 View Only

Passing parameters to macro from event to call a custom spel method

  • 1.  Passing parameters to macro from event to call a custom spel method

    Posted Oct 20, 2019 06:23 PM

    ​Hello All,

    I will try to cover what we wanted to achieve, we have created a custom object that will have a srel to chg object.

    Now when a chg is submitted we are attaching one event to that change object, This event will fire at specified time, during its firing we are adding a condition when this condition is false we are calling a macro to create a record for the custom object (this is being done with a custom spel method), I could see that event is firing successfully and trying to call the macro but it is not calling the spel method.

    in the background server I am seeing the following error
     macro event error 'Unknown message' 'chg:FAC:NC:ATTR:OB:MTH:'

    // Call the in house developed z_chg_create_gel spel method
    // to generate a new GEL record.
    //
    // Note: We are passing the following objects to the spel method:
    //
    // chg Object => (this)
    // atev Object => (attached_event)
    // evt Object => (event_tmpl)


    send_wait(0, top_object(), "call_attr", "chg", "z_chg_create_gel", this,
    attached_event, event_tmpl);

    if (msg_error()) {
    logf(ERROR, format("macro event error '%s' '%s'", msg[0], msg[1]));
    }

    this is the spel method name z_chg_create_gel.spl

    This is the function declaration

    string chg::z_chg_create_gel(…)

    Also declared this function as factory method in the chg.

     FACTORY {

        METHODS {

      z_chg_create_gel(object, object, object );
        };
            };



    ------------------------------
    Regards,

    ------------------------------