Here we describe what is done once a workflow is submitted by the users. A workflow job is represented by the class WorkflowJob. It does most of its work in the constructor:
The main constructor for a WorkflowJob takes three arguments:
the TextGridObject (TGO) representing the uninstantiated Workflow (tgwf format)
a String with the target project ID (e.g. TGPR123)
an ArrayList containg the URIs of the input TGOs to be processed
After reading the contents of the Workflow TGO, any stale TGO URIs possibly present in the workflow will be cleared and the URIs of the input TGOs will be inserted.
For each configuration parameter, it is checked whether it has to be encoded in Base64 format (as specified in the tgwf), and the full content of the respective parameter will be replaced by its encoded string.
The algorithm tries to set the target project in the XSLT stylesheet for the new metadata. Specifically, it looks for the Path “tgwf:tgwf/tgwf:metadatatransformation/xsl:transform/xsl:template/tgc:tgObjectMetadata/tgmd:administrative/tgmd:client/tgmd:project" and replaces the projectId found there with the one given by the target project ID string. This might fail due to the nature of the stylesheet given. In this case the workflow will not be able to start.
Now further settings known in the TextGridLab will be inserted:
CRUDs instance endpoint
TextGrid SessionID of the user
the logParameter for the loggingService
the description of the Workflow (taken from the TGO's title given in its metadata).
Now that the tgwf workflow is fully instantiated, it is transformed by an XSL engine according to the rules in the XSLT stylesheet described above into GridWorkflowDL format, which is stored in a String variable for later execution.
If everything went well during instantiation of the tgwf workflow and its transformation, the public method start() can be executed, meaning it will be transferred to the GWES engine under the user's name (initiated), and started. The further life of the job can be observed in the JobManagement view in the GUI (see below).
There is another constructor which takes only a String with the workflowID known by the GWES engine. This one is used when querying the GWES engine for properties of the active, or terminated, or completed workflows. Various public functions will use the data retrieved by this constructor, see the API documentation for a full list of them.