I have exposed a web-service from Appian which contains all the requests which are in pending status of not getting approved. I want to approve some of the requests from the web-service exposed. How can i achieve this? Can anyone help me on this.
When you say "contains" does this mean the WebService (WebAPI) is returning a list of the requests in a pending status? If so, you'll need a separate WebAPI to approve one or more of the reuqests. Your first service should return the unique identifiers of the requests and the second service should receive the identifier(s) and make the necessary updates.
Can u please let know on how to transfer the data from one web api to another? i.e. unique identifiers from one service to another.
Since a WebAPI is a service that is designed to be consumed from an external system then you'll have to design how to transfer data from Service A into Service B.
But I fear from the conversation so far that either I've misunderstood what you're trying to do, or that perhaps you've taken a wrong-turning in your design. So: if you want to express WHAT you're trying to achieve (not HOW, let's park that for the moment) then perhaps we an determine what options you have.
actually we have a list of pending approvals, this we exposed it as WebApi, now we are trying to approve/Reject these pending requests from that response which we get in webApi,
Ok. My first question then is: why are you exposing this list as a WebAPI? Why can you not build, for example, a User Interface in Appian, expose this list in that and implement the Approvals? That is: an entire solution in Appian?
Can you please share more details on what are you trying to achieve?
For me sounds like two steps
1) you need to get the list of all pending requests, sounds like you already have this solved?
2) approve a list of requests? Can you please elbarote what it means approve? Could it be just updating an status? Who is approving ? Does it already has a Appian task?
Please help us to understand your use case to give you better advice
It is already done in interface but the requirement is to be done in Web API so that it can be approved or rejected from outside the network of Appian. is it possible?
Of course it's possible, I just don't understand why it's "a requirement". What is being able to achieve this outside of Appian giving, in terms of value, to the Users?
Assuming this requirement cannot be challenged, you need to do as I said: treat the two stated aspects as TWO different WebAPIs: one to get the list to be approved, and the second to implement the actual Approval. Depending on your requirements you may design the second to approve only one Approval at a time, or approve an array of Approvals in a batch.
Can u please let us know how to implement the second Web API where the approval/ rejection actions can be performed?
The basic principle is that you need a value that correlates with the individual Approval available in your first Web Service, and that your second WebAPI will receive that value and update the Approval to be either Approved or Rejected. AT this point it depends on what your implementation is of an Approval. If it's a database entity, then your WebAPI can make a call to the Database using a!writeToDataStoreEntity() - you'll need to fetch the whole case first (which is why you need the correlating value), and change the value that represents the case status (Approved, Rejected) before writing it back to the database.
If you have a different implementation of your Approval case then the design principle holds true but the details of how to find and update the case might be different.
Discussion posts and replies are publicly visible
© 2019 Appian. All rights reserved.