If you have not worked with workflows yet, you can visit this article and get an overview on creating workflows.
Table of Contents
Use Case
After running an initial workflow from an empty graph, further analysis to gain new insights in your data can be executed via workflows. This can be handled with the Start with current graph-workflow template. The workflow will pick the current view with the GetCurrentDataView activity and extract the graph from it with the GetGraphFromView activity. Afterwards, the SetGraph activity sets the extracted graph to use it in the RunTransformation activity. This is where the calculations are done in a defined sequence. Finally the calculated graph is picked with the GetGraph activity and the ShowView activity visualizes the graph in the current view. In order to run this kind of workflow a graph file must be open and selected in the Workspace. Have a look at our activities article for more explanation on each activity or proceed with a detailed description how to build the workflow below.
How to build the workflow
To create a new workflow, right-click on the Workflows folder in the Solution Explorer , choose “New File” and then click on “Start With Current Graph” (2) in the Worflow Category (1). Give your workflow a name (3) and click on create (4).
Arguments
Arguments are optional and can be used to parameterize sequences or influence the workflow.
Workflow Activities
The figure below shows you the activities of a typical analysis workflow:
You can find the activities on the left-hand side as building blocks. Drag’n’Drop these to the workflow area. To find the right building block you can use the search field on top.
GetCurrentDataView
First get and store the current data view. This way even if the user switches to another window we still work with the view he or she would expect. If you select an activity, you can define its properties on the right-hand side.
Save the current view to the above-defined dataView variable.
GetGraphFromView
Now save the graph content from the dataView to the variable graph.
TransformationContext
Within a TransformationContext, you can run transformations (sequences, … ) on your graph.
SetGraph
SetGraph will assign the graph variable to the TransformationContext.
RunTransformation
RunTransformation lets you call sequences from your solution and run these.
For sequence provide the name of an import sequence from a .grg file in your solution. This sequence will be the ‘analysis’ of your workflow.
GetGraph
GetGraph takes the graph from your Transformation Context and saves it to the variable (see above) graph.
ShowView
ShowView sets our graph to a view.
DoNotCreateNewFile prevents creating a new file. But it will create a new view of your graph. By default, it will create one. If you want to see the changes in your current graph without opening a new view, then you should delete the option “ShowView” and add instead the option “SetGraphToView”. The steps are illustrated in the following figure.
FileNameTemplate gives you the possibility to provide a name for the file you create.
Graph is the graph variable we handled in the steps before.
TemplateContent is the dataView variable.
ViewFile is the view template you want to use in this view. NOTE: instead of .slvt only name .slv !
Now you can start the workflow from the Workflow Launcher pad. If you want to change the appearance or add a description, you can visit this article.