I tried to find a REST API for application message handling but that existing ones could not create a message.
(22R2)
Do you know a way to do this?
I tried to find a REST API for application message handling but that existing ones could not create a message.
(22R2)
Do you know a way to do this?
Hi.
From a workflow you can use the IFS REST call custom delegate.
More info here:
This delegate will invoke the HTTP request and provide the response along with the HTTP response code. Then you can parse the response body (XML/JSON using JSONPath) and extract the HTTP response code to proceed with additional logic.
Thank you much.
Best regards.
Gonzalo.
Hi Gonzalo,
Thanks for info on calling REST, that is useful, but my point was the creation of an Application Message.
Which would go to IFS Connect, get routed to an address and so on.
REST would definitely be one way to do that, but I cannot find the API for that purpose.
Do you have some idea on that?
Hi jasahu.
OK, now I understand you want to create an Application Message from a workflow. Then you will have to use a IFS Projection Delegate and use the projection/action that deals with Application Messages.
Is that what you mean?
Have you checked this projection?
main/ifsapplications/projection/v1/ApplicationMessagesHandling.svc
Best regards.
Gonzalo.
Yes, Projection Delegate could work too, provided I have the proper projection.
ApplicationMessagesHandling.svc or ApplicationMessageHandling.svc do not seem to help me, no possibility to create new msg.
Interestingly, ApplicationMessagesLobbyHandling.svc seems capable of creating app messages, in 3 steps, via action ImportMessage.
But is that the best option out there?
App message are far more important than getting such a bad treatment.
Hi.
May I know why you want to create an Application Message from a workflow? What would be the use case?
Thank you much.
Best regards.
Gonzalo.
We have an integration task, and have to communicate with the other app by way of files so I need to create an outbound app message which will become a file sent by FILE_SENDER.
And I am also interested in outbound SYNC app messages as well, to see how much we can accomplish in the future.
Hi jasahu.
I’m not able to locate a Projection that can create Application Messages. What if you force the creation of the Application Message from the workflow by triggering Custom Event. So you use a Projection delegate to create/update a record. Then that triggers the Custom Event and that Event has a Event Action of type Application Message. Then you will get your message created. Would that be valid?
Regarding the “I am also interested in outbound SYNC app messages as well” comment… Application Messages can be routed to HTTP Senders. These senders will get the response stored and you can configure IFS to process that response using a Routing Rule + Routing Address. But bear in mind that when you create an Application Message, it will be handled by a queue in ASYNC manner.
Best regards.
Gonzalo.
Hi Gonzalo,
Regarding App Msg creation via Custom Event:
That could work, but this is more complicated than what I wrote above using ‘ImportMessage’, but good to know as an alternative.
Regarding outbound SYNC:
It is not about he connector being sync or async, it is about the message itself being sync.
That means that the message does not get into any queue (like OUT1), but it gets executed immediately.
Action of type ‘Application Message’ of a Custom Event cannot do that that is always async.
Plsqlap_Server_API.Invoke_Outbound_Message would do that in SYNC for me, if there was a way to call that from Workflow.
BR
Janos
Hi did you succeed to create an outbound sync application message from Workflow ?
Hi did you succeed to create an outbound sync application message from Workflow ?
Hi,
No, unfotunately I did not
If you have access to Studio Developer, it should be fairly trivial to create a Custom Projection Action, then to define the PLSVC file for that action to call PLSQLAP_SERVER_API.Invoke_Outbound_Message, if that’s the API you want to call.
Then if that Projection (in which you’ve created the custom Action) is one that’s Enabled in API Explorer, you should be able to call the action from a Workflow if that’s what you’re trying to do.
I did check (24R2) and indeed I can’t see any out of the box Projection SVC Package that currently contains a call to that API method, so you’d have to create one.
Hi,
Thank you,
I was expecting that solution.
As there is a clob parameter in Invoke_Outbound_Message procedure, there might be a problem with a workflow that is calling a Custom Projection Action with that parameter.
regards
You might need to make the action use a different type as an input then convert the input to CLOB within the PLSVC logic itself.
Note that typically, if an action/function has a parameter defined with type LongText, this automatically converts the input to CLOB and is available as CLOB to use within the PLSVC Package.
Thank you
I created a new API “CFndStreamExtensionService” with a action: “PostOutboundMessage”
Can you show us the Studio Developper side of it ? Specifically how you defined the Action and associated PLSVC Logic ?
(Also another test you can do is to define your action as a custom action through an override of an existing projection in which you can actually see the action calls, this might help make it appear in that other projection, maybe).
You might also want to make sure you refreshed all caches and log out/back in the application just in case.
projection CFndStreamExtensionService;
component NTFYME;
layer Cust;
description "Put some useful description here ...";
category Integration;
--------------------------------- FRAGMENTS ---------------------------------
----------------------------- MAIN ENTRY POINTS -----------------------------
entityset FndStreamExtensionSet for FndStreamExtension;
------------------------------ ENTITY DETAILS -------------------------------
------------------------------- ENUMERATIONS --------------------------------
---------------------------------- QUERIES ----------------------------------
---------------------------------- ACTIONS ----------------------------------
action PostOutboundMessage {
initialcheck implementation;
parameter File Text;
parameter Sender Text;
parameter Receiver Text;
parameter MessageType Text;
parameter MessageFunction Text;
}
=======================================================================
-------------------- LU SPECIFIC PUBLIC METHODS -----------------------------
PROCEDURE Post_Outbound_MessageTest (
file_ IN VARCHAR2,
sender_ IN VARCHAR2,
receiver_ IN VARCHAR2,
message_type_ IN VARCHAR2,
message_function_ IN VARCHAR2)
IS
clob_ CLOB;
BEGIN
clob_ := TO_CLOB(file_);
Plsqlap_Server_API.Post_Outbound_Message(
clob_,
sender_ => sender_,
receiver_ => receiver_,
message_type_ => message_type_,
message_function_ => message_function_);
END Post_Outbound_Message;
I refreshed dictionary cach in IFS
Not sure how you did that but your Procedure Name doesn’t match the Action.
The procedure name is typically converted, here there’s a weird “Test” that has been added at the end.
Doing it like this (I have overriden a random projection to do this):
Thank you ,
Sorry, here is the good code generated:
PROCEDURE Post_Outbound_Message___ (
file_ IN VARCHAR2,
sender_ IN VARCHAR2,
receiver_ IN VARCHAR2,
message_type_ IN VARCHAR2,
message_function_ IN VARCHAR2)
IS
clob_ CLOB;
BEGIN
clob_ := TO_CLOB(file_);
Plsqlap_Server_API.Post_Outbound_Message(
clob_,
sender_ => sender_,
receiver_ => receiver_,
message_type_ => message_type_,
message_function_ => message_function_);
END Post_Outbound_Message___;
Like I said, I’m not sure how it works exactly with custom projections, but have you tried just override an existing projection just to see if the Call then appears? It does for me, as long as you pick a Projection that it makes sense to override, I think that’d be ok?
Yes , I’m trying to do it :
I overrided an existing projection (CustomerHandling) with a call :
It looks to work better but i have now the problem when i deploy the workflow:
I started again IFS : the error message disappeard
The workflow is now working:
when i have created a new customer, the workflow started and send a message to IFSConnect
Good to hear, although to be clear
This bit
Is unneeded if you define the projection action and related PLSVC logic through Studio Developer, the action becomes part of the projection you’re overriding, no need to do anything else.
To reiterate, what I’m suggesting is that you define the action and plsvc not in your custom projection of CFndStreamExtensionService but directly in another, out of the box projection (such as in ApplicationMessageHandling).
That way you don’t need to define anything in the config layer :)
Still a bit unclear as to why your custom projection definition didn’t work though, especially if the action call was visible in the API doc (which it was as you demonstrated in a screenshot), I can’t think of any reason it wouldn’t be available as a call in a workflow.
Did you actually define both the action (the one without TEST at the end) AND the plsvc logic in the same files? (Unclear why you’re calling the method from fnd_stream_extension_api and not simply from c_fnd_stream_extension_service_svc)
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.