创建一个用户非交互命令行OMFCL的消息

1、定义一个外部、 消息,like CommandLineMsg
   define external class message clShutMsg like CommandLineMsg;
 
2、将新消息attach到指定类上面去:
   attach class message clShutMsg to PdmSessn in server bbksvr;
 
3、写消息方法体,这里只是简单调用一下PdmSessn的ShutDownWarnningMsg
message PdmSessn:clShutMsg
   (
       input :      string          className ::
       input :      SetOfStrings    parameterSet ::
       output:      SetOfStrings*   outputSet ::
       output:      integer*        mfail
   ) code
{
   MODNAME("PdmSessn:clShutMsg");
  
   status dstat = OKAY;
  
   *mfail = USC_OKAY;
  
   dstat = ShutDownWarnningMsg(className, mfail);
  
  
CLEANUP:
 
EXIT:
   if (dstat)
   {
       uiShowFatalError(dstat, WHERE);
   }
   return dstat;
}
;
 
4、测试使用
   打开命令行,输入以下命令
   omfcl PdmSessn clShutMsg
   回车
原文地址:https://www.cnblogs.com/hcfalan/p/422523.html