Services
One the primary benefits of having a workflow engine is that it can interact with external services. In turn, these services can interact with the workflow. This two way communication allows TACTIC to execute actions on other services and it also allows external services to create events within the workflow engine
Calling an external service from a workflow
Using the REST node
The REST process node is an easy way to send messages to an external service
Using an action node
TODO
Using a custom node
TODO
API code
The easiest way for an external service to initiate an event within a TACTIC workflow is through the API.
The following code snipped uses the Python API handle to send a message to a TACTIC workflow:
server = TACTIC.get()
# The parent sobject that owns the workflow
search_key = "workflow/job?project=workflow&code=JOB000232"
# The process to execute
process = "Run Service"
# The event to run
event = "complete"
# Any extra data to be sent to the workflow
data = {}
# call the event
ret_val = server.call_pipeline_event(search_key, process, event)
Go here for more information on the TACTIC API
This can be just as easily done using the REST interface.
server = "http://<server_op>/<project>"
import requests
headers = {}
params = {
"method": "call_pipeline_event",
"search_key": search_key,
"process": process,
"event": event
}
ret_val = requests.post(server, headers, params)
These simple code snippets show how TACTIC can interface with an external service and how those external services can communicate back to the TACTIC service.