Hi,
I'm new to Switchyard and need a recommendation on how to design this integration scenario. I need to integrate various sources to one particular application that provides a REST api. In order to use this external application's REST api, one needs to authenticate with the system (username/password), receive a token, and then that token will be used for all other service invocations. Now lets consider a simple example where I would like to insert an "Item" into this application. Hence I would need to first invoke a REST service to authenticate, receive the token, and then call an insert REST service with the token to insert the item:
1) String authenticate(String username, String password)
2) void insert(String item)
Now how would you design this workflow scenario in SY? Currently I've created an 'empty' bean (this will be another question I have below) that has a promoted reference to the external application. This reference is a Java interface with jax-rs annotations that conform to the external application's requirements. I've created two methods in this reference interface that use the signatures shown above. Now when data is coming in (from a database), I need to first authenticate to get a token then insert the item. So far I have an implementation that looks like the attached image. The component in the middle has no implementation (or interface for that matter, its completely empty). I'm not sure what I need to put in that component. I'd figure I just "map" the input to two composite references-- 1 for authentication and the other for inserting the item.