Understanding Process Status Notification
Process status notification provides the ability to publish a process request status notification either locally or to a remote application. Upon receipt of the notification, you can trigger additional logic in your application based on the notification results. Notifications are published using service operations and routed by the Integration Broker. The service operation PRCS_STATUS_OPER is delivered and triggered when the SetNotifyAppMethod is invoked. This service operation does not contain any delivered routings. You can also create your own service operation and trigger it with the SetNotifyService method.
SetNotifyAppMethod
This method allows you to create your own application class to handle the notification and information you want to send. This method will invoke the service operation PRCS_STATUS_OPER, as shown in this diagram:
SetNotifyAppMethod
This method allows you to create your own application class to handle the notification and information you want to send. This method will invoke the service operation PRCS_STATUS_OPER, as shown in this diagram:
SetNotifyAppMethod
To use this method:
1. Create an application class to handle notifications.
This is an example of an application class to handle notifications:
class ProcessNotification
method ProcessNotification();
method ReceiveNotification(&_MSG As Message);
end-class;
method ProcessNotification
end-method;
method ReceiveNotification
/+ &_MSG as Message +/
Local Rowset &rs_msg, &NotifyInfo;
Local Message &message;
Local string &sName, &sValue;
&rs_msg = &_MSG.GetRowset();
/*************************************************************/
/* Add logic you want to execute upon receiving notification */
/* For example : */
/* &RQST.SetNotifyAppMethod("RECEIVE_NOTIFICATION:ProcessNotification",⇒
"ReceiveNotification"); */
/* &RQST.AddNotifyInfo("SQR Report", "XRFMENU"); */
If &rs_msg(1).PRCS_STATUS.RUNSTATUS.Value = "9" Then /* process ran to success⇒
*/
&NotifyInfo = &rs_msg.GetRow(1).GetRowset(Scroll.PRCSNOTIFYATTR);
/* if you have more name-value pairs */
/* add code to traverse the rows from the PRCSNOTIFYATTR rowset*/
/* e.g. Get the first name-value pair */
&sName = &NotifyInfo(1).PRCSNOTIFYATTR.PRCS_ATTRIBUT_NAME.Value;
&sValue = &NotifyInfo(1).PRCSNOTIFYATTR.PRCS_ATTRIBUT_VALU.Value;
/* logic to excute on success */
/* e.g. submit another process */
Local number &PrcsInstance;
Local ProcessRequest &RQST;
&RQST = CreateProcessRequest();
&RQST.ProcessType = &sName;
&RQST.ProcessName = &sValue;
&RQST.RunControlID = "test";
&RQST.RunLocation = "PSNT";
&RQST.OutDestType = "WEB";
&RQST.OutDestFormat = "PDF";
&RQST.RunDateTime = %Datetime;
&RQST.TimeZone = %ServerTimeZone;
&RQST.Schedule();
Else
/* other processing */
End-If;
/*************************************************************/
end-method
2. Include SetNotifyAppMethod, using the application class and method created in step 1, in the process request.
3. Optionally, use AddNotifyInfo to include specific information in the message that will be published.
This is an example of a process request:
/***********************************************************************
* Construct a ProcessRequest Object. *
***********************************************************************/
&RQST = CreateProcessRequest();
&RQST.ProcessType = "SQR Report";
&RQST.Processname = "XRFMENU";
&RQST.RunControlID = "TEST";
&RQST.OutDestType = "WEB";
&RQST.OutDestFormat = "PDF";
&RQST.NotifyTextMsgSet = 65;
&RQST.NotifyTextMsgNum = 237;
&RQST.RunDateTime = %Datetime;
&RQST.TimeZone = %ServerTimeZone;
&RQST.SetNotifyAppMethod("RECEIVE_NOTIFICATION:ProcessNotification",⇒
"ReceiveNotification");
&RQST.AddNotifyInfo("SQR Report", "XRFMENU");
&RQST.Schedule();
&PRCSSTATUS = &RQST.Status;
&PRCSINSTANCE = &RQST.ProcessInstance;
If &PRCSSTATUS = 0 Then
MessageBox(%MsgStyle_OK, "", 65, 366, "Process Instance", "XRFMENU",⇒
&PRCSINSTANCE);
Else
MessageBox(%MsgStyle_OK, "", 65, 0, "Process Instance", "Process Not⇒
submitted");
End-If;
4. Add an outbound routing to the service operation PRCS_STATUS_OPER pointing to your remote system.
5. On the remote system add an inbound routing to the service operation PRCS_STATUS_OPER.
SetNotifyService
This method requires you to create your own service operation and service operation handler to publish the message when the process request completes.

To use this method:
1. Create a service operation and service operation handler to handle the notification. The service operation must use the message definition PRCS_STATUS_MSG.
Note: This service operation and all its related metadata, such as message and handler classes must be on all participating systems. You can create a project in Application Designer and migrate the definitions.
2. Include SetNotifyService using the service operation created in step 1 in the process request.
3. Optionally, include AddNotifyInfo in the process request.
4. Add an outbound routing to the service operation you created in step 1 pointing to your remote system.
5. On the remote system add an inbound routing to the service operation you created in step 1.
To use this method:
1. Create an application class to handle notifications.
This is an example of an application class to handle notifications:
class ProcessNotification
method ProcessNotification();
method ReceiveNotification(&_MSG As Message);
end-class;
method ProcessNotification
end-method;
method ReceiveNotification
/+ &_MSG as Message +/
Local Rowset &rs_msg, &NotifyInfo;
Local Message &message;
Local string &sName, &sValue;
&rs_msg = &_MSG.GetRowset();
/*************************************************************/
/* Add logic you want to execute upon receiving notification */
/* For example : */
/* &RQST.SetNotifyAppMethod("RECEIVE_NOTIFICATION:ProcessNotification",⇒
"ReceiveNotification"); */
/* &RQST.AddNotifyInfo("SQR Report", "XRFMENU"); */
If &rs_msg(1).PRCS_STATUS.RUNSTATUS.Value = "9" Then /* process ran to success⇒
*/
&NotifyInfo = &rs_msg.GetRow(1).GetRowset(Scroll.PRCSNOTIFYATTR);
/* if you have more name-value pairs */
/* add code to traverse the rows from the PRCSNOTIFYATTR rowset*/
/* e.g. Get the first name-value pair */
&sName = &NotifyInfo(1).PRCSNOTIFYATTR.PRCS_ATTRIBUT_NAME.Value;
&sValue = &NotifyInfo(1).PRCSNOTIFYATTR.PRCS_ATTRIBUT_VALU.Value;
/* logic to excute on success */
/* e.g. submit another process */
Local number &PrcsInstance;
Local ProcessRequest &RQST;
&RQST = CreateProcessRequest();
&RQST.ProcessType = &sName;
&RQST.ProcessName = &sValue;
&RQST.RunControlID = "test";
&RQST.RunLocation = "PSNT";
&RQST.OutDestType = "WEB";
&RQST.OutDestFormat = "PDF";
&RQST.RunDateTime = %Datetime;
&RQST.TimeZone = %ServerTimeZone;
&RQST.Schedule();
Else
/* other processing */
End-If;
/*************************************************************/
end-method
2. Include SetNotifyAppMethod, using the application class and method created in step 1, in the process request.
3. Optionally, use AddNotifyInfo to include specific information in the message that will be published.
This is an example of a process request:
/***********************************************************************
* Construct a ProcessRequest Object. *
***********************************************************************/
&RQST = CreateProcessRequest();
&RQST.ProcessType = "SQR Report";
&RQST.Processname = "XRFMENU";
&RQST.RunControlID = "TEST";
&RQST.OutDestType = "WEB";
&RQST.OutDestFormat = "PDF";
&RQST.NotifyTextMsgSet = 65;
&RQST.NotifyTextMsgNum = 237;
&RQST.RunDateTime = %Datetime;
&RQST.TimeZone = %ServerTimeZone;
&RQST.SetNotifyAppMethod("RECEIVE_NOTIFICATION:ProcessNotification",⇒
"ReceiveNotification");
&RQST.AddNotifyInfo("SQR Report", "XRFMENU");
&RQST.Schedule();
&PRCSSTATUS = &RQST.Status;
&PRCSINSTANCE = &RQST.ProcessInstance;
If &PRCSSTATUS = 0 Then
MessageBox(%MsgStyle_OK, "", 65, 366, "Process Instance", "XRFMENU",⇒
&PRCSINSTANCE);
Else
MessageBox(%MsgStyle_OK, "", 65, 0, "Process Instance", "Process Not⇒
submitted");
End-If;
4. Add an outbound routing to the service operation PRCS_STATUS_OPER pointing to your remote system.
5. On the remote system add an inbound routing to the service operation PRCS_STATUS_OPER.
SetNotifyService
This method requires you to create your own service operation and service operation handler to publish the message when the process request completes.

To use this method:
1. Create a service operation and service operation handler to handle the notification. The service operation must use the message definition PRCS_STATUS_MSG.
Note: This service operation and all its related metadata, such as message and handler classes must be on all participating systems. You can create a project in Application Designer and migrate the definitions.
2. Include SetNotifyService using the service operation created in step 1 in the process request.
3. Optionally, include AddNotifyInfo in the process request.
4. Add an outbound routing to the service operation you created in step 1 pointing to your remote system.
5. On the remote system add an inbound routing to the service operation you created in step 1.

1 comment:
More than 5000 registered consultants and corporates.
Request IT online training at www.todaycourses.com
Post a Comment