Follow these steps to use WS++:
- Add
"#include <WSpp/WS.hpp>"
where you'd like to call Workflow/Spaces.
- There is a single C++ object to instantiate named fc::WS.
- This class is relatively small, and an object of this type can be instantiated on the stack or embedded as a member of another class.
- If anything goes wrong while using
fc::WS
it will throw a C++ exception, so there is no need to continously check result codes. See FC++ Exceptions for details.
- Call the following methods on the
fc::WS
object:
- fc::WS::login()
- Inspect the results stored in the string fc::WS::server_xml to get all the required fields.
- Create a
fc::StrMap
with all the field names and values described in the XML. This is required for the next step when making the call to fc::WS::createJob()
- fc::WS::createJob()
- Name the form to use, and specify all the required fields.
- fc::WS::queueSingleFile() or fc::WS::queueRecursiveDirectory()
- These two calls can be specified as many times as necessary to queue up either individual files, or recursively traverse a directory tree.
- fc::WS::uploadQueuedFiles()
- Once all the necessary files have been queued, call
uploadQueuedFiles
() to upload the files to the server. If the upload is expected to take long, then fc::WS::doNothing() will need to be periodically called on a secondary thread to ensure the connection to the server doesn't time out or is reset by a firewall.
- In addition to uploading the queued files, this will also upload the transfer logs and finalize the job originally started in
createJob
()
- fc::WS::logout()
- You don't have to explicitly call
logout
(), it will be called automatically when the WS
object goes out of scope.