Skip to content

3 Using microservices

yqjiang edited this page May 28, 2013 · 13 revisions

3.1 Create a workflow

3.1.1 Opening an Existing workflow

If we already have a workflow:
1. Go to file.
2. Open Workflow.
3. Navigate to your existing file.
4. Click “OK”, the workflow diagram and the workflow panel will propagate.

3.1.2 create a new workflow

If we want to create a new workflow, here are the steps that will be performed.
Steps:
1. Choose a new workflow from the file menu.
2. Add services to Taverna.
1) click import new service and then click on WSDL services from the dropdown.
2) Enter the URL of WSDL. Say for an example, we are making a list of countries workflow and the url here is: http://www.webservicex.com/globalweather.asmx?WSDL
3) Click ok and the service will be added.
3. Now we can filter, say we filter by globalweather, then you can see the two new services under

“WSDL @ http://www.webservicex.com/globalweather.asmx?WSDL”.

4. To add service, click on GetCitiesByCountry in the service panel and drag it into the Workflow Diagram or to the tree in the workflow Explorer.
5. the workflow needs input, in our case we will use country to the query. Right click on the blank area of the workflow Diagram and select insert--> Workflow input port. Enter the name of the port(country in our case). Click ok and new input appear in the workflow diagram and the workflow Explorer.
6. Now to output, we need to do the same thing except insert → workflow output port and using the name “cities” to create an output.
7. to split the WSDL inputs and outputs, right click on the service GetCitiesByCountryin the workflow Diagram or Workflow Explorer and select show details. Scroll down and add input XML splitter and Add output XML splitter, choosing parameters in both cases.
8. To link the input port, click on “country” and drag to the “GetCitiesByCountry_input”. A arrow connection will be established. If there are multiple ports that could have been connectd multiple options with arrows will be shown.
9. Similarly output port can be linked by selecting and draging to “GetCitiesByCountry”. A green arrow will show up in this case.
10. We can run the workflow by file---> Run workflow. In the workflow inputs dialog, we can click new value button and replace the string by your chosen value.

3.1.3 Create a workflow with Islandora Microservices

The process for creating a workflow with Islandora microservices is similar to above. However, there are details specific to these microservices.
The detail of Microservices can be find here:

https://github.com/roblib/php_listeners/wiki/Microservice-Functions---Accepted-File-Extensions

To use them, input ports must be added for all inputs, or a constant value set in the workflow for that input. An output port must also be set to receive the exit_status, but is not needed for attachment list.
The exit_status can be find here:

https://github.com/roblib/php_listeners/wiki/Microservice-Troubleshooting-Guide#error-explanations--points-of-failure

The code can potentially be changed to return not just an exit status, but the DSID of the generated output for use in chaining microservices. However, this is not currently implemented.

3.2 Trigger t2flow

3.2.1 Add Trigger-Datastreams to content model

The content model has a data stream named "Trigger-Datastreams" which dictates when each t2flow should be run.
"Trigger-Datastreams" contains each method type (e.g ingest, addDatstream, modifyDatastreamByReference, etc )
Inside each method type, we can dictate any t2flows that should be run whenever a method occurs.
We can also dictate that a t2flow should only be run when the method occurs on a specific data stream. There are several methods that are supported for the trigger datastreams object.
Those are:
modifyDatasstreamByValue - modifying a fedora object’s datastream value
modifyDatastreamByReference - modifying a fedora object’s datastream content
ingest - creating a new fedora object
purgeObject - purging a fedora object
purgeDatastream - purging individual datastream
addDatastream - adding a new data stream
A example datastream can be find here:

https://github.com/roblib/php_listeners/wiki/An-Example-Trigger-Datastreams

E.g A t2flow should be run when a data stream is modified, and that data stream's dsid is "OBJ".

3.2.2 Add Workflow to an content model

Adding a T2Flow document created in the taverna workbench to a current content model for future use can be done through the following steps:
1. Log into the fedora admin server.
Default address will look like http://192.168.56.195:8080/fedora/admin however this may vary depending on fedora installation. Input appropriate credentials to log in.
2. On the search tab on the right enter the name of the content model. For example: “audio” would be used to search for the audio content model. Select the appropriate option from the drop down menu.
3. Next, add a new datastream. Enter the information displayed in the image below
This should cause a new datastream to be created for the object and allow the t2flow object to be added to the content model. Refresh the data streams.
4. This can be verified by opening the object’s XML via the view object xml option.
Note: There will be many t2flow documents stored for each content model. They will all be of the type t2flow-doc, however they will have unique identifying datastream IDs or UUIDs.

< previous page | next page >

Clone this wiki locally