How Trigger Method (Client Code) or Button from Business Process?
Like
1 comments
14:09 Jan 31, 2023
Hi,
You can trigger your client code in the business process by using message logic.
For example, in the business process you need to create a script task in which you will send a message:
string messageToShow = Get<string>("MessageToDisplay");
Terrasoft.Configuration.MsgChannelUtilities.PostMessage(
UserConnection,
"VisaMessage",
JsonConvert.SerializeObject(new {
Message = messageToShow
}));On your client schema, you need to subscribe to this message and call the needed method:
init: function (){
Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE, this.onBPMessage, this);
this.callParent(arguments);
},
onBPMessage: function(ws, data) {
var isVisaMessageSender = data.Header.Sender == "VisaMessage";
if (isVisaMessageSender) {
// Do something
},
Show all comments