Automation Template Scenarios
Contents
Scenario
The Core delegated creation dialog specification assumes that the resource is immediately created when the user exits the dialog. Automation added “execution” as an immediate consequence of Automation Request creation. In some scenarios the user may want one behavior without the other.
Scheduled execution
The user wants to use an orchestrator or a scheduler (consumer) to periodically execute an automation plan (on the provider).
- The user opens the provider user interface to define scheduling rules and uses a dialog of the provider to define the automation request. This automation request does not have to be submitted for execution yet.
- The scheduling rules and the “template” of the automation request are saved in a resource on the consumer
- When the scheduling rules are matched, the orchestrator triggers the execution of the action by creating the automation request from the “template” the user previously defined.
Execution that requires an approval process
The user wants to execute an action that requires an approval process.
- The user opens the ticketing interface and from this interface invokes a delegated dialog to define the automation request.
- The “template” of the automation request and all the other information about the ticket (priority, due date…) are saved in a resource on the consumer.
- Following the approval process, this ticket is processed by the approver, if the ticket is approved, the ticketing tool triggers the execution of the action by creating the automation request from the “template” the user previously defined.
Variations
- The “scheduling smarts” could be in either actor, provider or consumer. The scenarios above are currently written to assume one of these, but this is exemplary, not limiting.
- The template might be saved in either actor, provider or consumer. The scenarios above are currently written to assume one of these, but this is exemplary, not limiting.
Proposal for Resource Template Creation Dialog
OSLC Automation service providers support the selection and creation of Automation resources as defined by Delegated UIs in OSLC Core and extends the behavior of the delegated UI dialogs with a new type of dialog:the resource template creation dialog.
Resource Template Creation Dialog: when a user of a web application needs to create a new resource definition that can be used by the UI consumer for delayed creation of resources. In this case the web application asks the service provider to provide a UI for resource template creation and the provider notifies the application when the template creation has been completed or canceled by the user.
The resource template creation dialog returns a URI of a template resources. A GET on the template resource URI returns the representation of the resource to be provided to the creation factory. The consumer can store this resource representation for one or more subsequent resource creation.
The service providers supports requirements for delegated UIs is as follows:
Automation Resource |
Selection |
Creation |
Template Creation |
AutomationPlan |
SHOULD |
MAY |
MAY |
AutomationRequest |
MAY |
SHOULD |
MAY |
AutomationResult |
SHOULD |
MAY |
MAY |
Resource Template Creation Dialog
Resource Template Creation Dialog can be used when a UI Consumer wants to allow a user to create a new resource that is managed by an OSLC Service. Using either the Post Message or Window Name protocols defined above, the UI Consumer uses an iframe to embed a resource template creation dialog that is provided by the service, then awaits notification that the user has configured the resource to be created.
To enable Resource Template Creation, an OSLC Service MUST provide in its Service Resource a value for the oslc:templateCreationDialog property or a specific usage in one of the creation dialogs (TO BE DISCUSSED). The property value will include a oslc:dialogURI property that indicates the URI of the resource creation dialog.
Regardless of how the response from the UI Provider is conveyed to the UI Consumer, the response SHOULD be formatted as defined by oslc:results
Example:
{“oslc:results”:
[
{
“oslc:label”:”Automation Request”,
“rdf:resource”:”http://host:port/context/automationrequest?plan=b5fa212f-9c18-384e-bdff-e287716bd464”
}
]
}
Example of a GET on the template:
GET /context/automationrequest?plan=b5fa212f-9c18-384e-bdff-e287716bd464”
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:dcterms='http://purl.org/dc/terms/'
xmlns:oslc='http://open-services.net/ns/core#'
xmlns:oslc_auto='http://open-services.net/ns/auto#'>
<oslc_auto:AutomationRequest>
<dcterms:title>AUTOMATION REQUEST</dcterms:title>
<dcterms:identifier>1</dcterms:identifier>
<oslc_auto:state rdf:resource='http://open-services.net/ns/auto#new'/>
<oslc_auto:executesAutomationPlan rdf:resource='http://nc006249.romelab.it.ibm.com:34115/CLIModelWeb/OSLC/BatchApplicationInstance/JobStream/b5fa212f-9c18-384e-bdff-e287716bd464'/>
</oslc_auto:AutomationRequest>
</rdf:RDF>
Prefilling Resource Template Creation Dialogs
Service providers MAY support receiving a POST request whose content body is a resource definition to the Creation or Resource Creation or Resource Template Dialog URI to retrieve a URI that represents the embedded page to be used. Service providers MUST respond with a response status of 201 (Created) with the response header Location whose value is the URI to request the newly created form. After some elapsed time, service providers MAY respond with a 404 (Not Found), 410 (Gone) or 3xx (Redirect) to an HTTP GET request for these URIs.
The following diagram shows the interactions to create a resource:
Important notes:
- The resource template fabrication dialog can be identified in the registry using a particular usage of the creation dialog
- The resource template resource could be temporary and the consumer
should get it within a limited period of time
- The resource template resources are not persisted and cannot be
queried
- Implementation suggestion: the URI of the resource template could contain the resource representation of the resource, compressed and encoded.