With {{UBIK}} Smart Studio, project engineering is made easier: Smart Modelling means to build meta models, do programmatic customizing and ACM configurations without having to work all the repetetive repetitive details. {{UBIK}} Smart Modelling automates as much as it can in order to give the engineer leeway to actually do the project.
On the Augmensys [[https://release.augmensys.com/download/modules/Studio/ release portal]], a test candidate for the beta version of {{UBIK}} Smart Studio is available. Here's the history of recent changes:
[[Smart_Studio_Beta_History]]
[[File:UI_SmartStudio.png|thumb|400px|{{UBIK}} Smart Studio]]
== IDE ==
The IDE of {{UBIK}} Smart Studio was greatly inspired by Microsoft Visual Studio and similar development environments. This means that well-known and proven concepts, such as free docking of Tools, Documents and Controls is supported by Smart Studio and it's following the same usability principles.
==Usage= Options ==={{UBIK}} Smart Studio features a centralized Options center where all installed modules inject their configuration settings. By default, this can be reached through ''Tools → Options'', or, if the respective module supports it, from the context-menu of the module.
=== Tools ==={{UBIK}} Smart Studio provides SmartStudio is designed as an integrated developer environment (IDE) and administration tool. With {{UBIK}} SmartStudio, you can work on a project and transport the following tools:results, and you can interact with a {{UBIK}} Environment (data base, web services, etc.). Also, you can import meta definitions from external files (e.g., from Excel worksheets describing a customer's entities).
==== Pickers ====Pickers The central use-cases for {{UBIK}} SmartStudio are meant modelling and transportation. Modelling means to provide certain build up a new {{UBIK}} meta model, objects for usage in other controlsand customizing, so they mainly server as a Drag&Drop source during the engineering processor to maintain and develop an existing project.{| class="wikitable sortable"|-! Picker !! Types Transportation means to pick !! Target controls|-| Class Picker|| [[MetaClass|MetaClasses]]|| [[Inheritance Graph]]get {{UBIK}} meta data, [[Application Graph]], [[Inspector]]|-| Property Picker|| [[MetaProperty|MetaProperties]]|| [[Inheritance Graph]], [[Application Graph]], [[Inspector]]|-| Classification Picker|| [[Classification|Classifications]]|| [[Inheritance Graph]], [[Application Graph]]|-| ACM Picker|| [[Application|Applications]] objects and [[Context|Contexts]]|| [[Application Graph]]customizing from one place to another. This includes import from external systems or files, [[extraction from an existing {{UBIK}} Environment View]]|-| Selective Lists|| [[SelectiveList|Selective Lists]]|| [[Inheritance Graph]], [[Inspector]]|-| Query Picker|| [[Query|Queries]]|| [[Inheritance Graph]]and integrating {{UBIK}} meta definitions, [[Application Graph]], [[Inspector]]|-| Unit Picker|| [[UnitItem|Unit Items]]|| [[Inheritance Graph]], [[Inspector]]|-| Workflow Picker|| [[Workflow|Workflows]]|| [[Snippet Editor]]|-| RelationPicker|| [[Relation|Relations]]|| [[Inspector]]|objects and customizing into a new or existing {{UBIK}} Environment.
==== Object Finder ====The [[Object_Finder]] is a tool In order to support these use-cases optimally, {{UBIK}} SmartStudio provides modelling and transportation tools as well as sophisticated mechanisms for finding aiding your work: By automating as much as possible, {{UBIK}} SmartStudio helps preventing mistakes, ensuring consistency, minimizing unnecessary and using MetaClasses tedious effort, and Instances in your worksheetsenabling you to concentrate on what you really want to do.
=== Basic handling idea ===
Assuming a modelling use-case, you might want to define the meta model for a project. You launch {{UBIK}} SmartStudio and create a new Smart Project. To start working, you open the Inheritance Graph using the menu.
In the middle of the screen, there is a worksheet that can be used to draw the project structure on. Add new or existing models by dragging them from the pickers on the left of the screen to the worksheet area in the middle. Connect the models using lines in order to define the models' dependencies on each other. When a model is selected, it can be edited using inspector tools on the right of the screen.
The first step when using {{UBIK}} Smart Studio always is to open a project (or create a new one). Then you can open an existing worksheet or create a new one and start modelling.
Later, you can save your models to the project. Independent on the project, you can punctually save the current state of a worksheet (its "Situation") to the {{UBIK}} environment (database), if it is connected.
==== Error List =Organizing your work ===The Error List module shows notifications in the following categories{| class="wikitable sortable"|-! Category !! Meaning|-| Error || Errors that occurred in the {{UBIK}} core or in the IDE of Smart Studio; should be reported In order to organize your work and to Support in any case!|-| Warning || Warnings that occurred in the {{UBIK}} core or in separate modelling from working directly on the IDE of (productive) system, there are Smart Studio; typically not critical Projects. They serve as a container for your work, giving you the operation of possibility to punctually interact with {{UBIK}}|-| Message || Informational messages|-| Database || Messages from Environments (databases). This allows the {{UBIK}} data layer|user to transport (and re-| Service || Messages from the use) smart models between different {{UBIK}} Web Services|-| Workflow || Messages from the {{UBIK}} Workflow Engine|-| Custom || Messages generated by customizing code|}Environments.
==== Output =Transport Container ===The Output tool shows debug Sometimes, you don't want to design a data model but instead take it from one {{UBIK}} Environment to another, or to control in detail what you want to save to a target {{UBIK}} Environment. This is what the [[Transport Container]] is for. This worksheet (like the project view) features a [[Situation Editor]] giving you a detailed overview about the models it contains as well as the possibility to add or remove models, and error messages in plain text formatto select a subset of the contained models and do something with it (e.g., retain only the selected models).
==== Immediate Window =Inheritance Graph ===There are multiple kinds of modelling worksheets with different responsibilities: The [[Inheritance Graph]] allows the user to create meta models. It's called "Inheritance Graph" because the MetaClasses' inheritance structure is displayed graphically.
The Immediate Window allows for scripting of C# code on ==== Meta Classes ====You can drop existing meta classes onto the fly, without compilation; evaluation of graph in order to see the script happens as soon as the {{KeyPress|Enter}} key is pressedfull inheritance hierarchy, but statements are classifications and meta properties. You can also cumulative. This means that if e.g. drop a new meta class from the line <code>var a = SUIS.SelectedObject</code> is executedtool box picker, the variable ''a'' is preserved for all subsequent statements and can therefore be used in the next lines; so the following statement <code>a.Name</code> will deliver a correct valueproceed to model it by dropping meta properties onto it, or connecting it to other meta classes to establish an inheritance hierarchy.
==== Meta Properties ====
The details of meta properties can be configured in the inspector tool for a selected meta property. The options include data type, selective list, unit, multi language, etc.
Live value meta properties are supported, too.
==== Classification ====
It is also possible to specify classifications for meta classes by dropping the classification onto the graph and then connecting it to the respective meta class.
Classifications are not implemented immediately to prevent undesired changes. Select the connection between the classification and the meta class, and toggle the "implement classification" checkbox in the inspector tool for the connection, in order to add the classification's meta properties to the meta class.
Classifications can be designed just as meta classes, but inheritance of classifications is currently not supported.
==== Relations ====
Relations can be designed in the relation editor (by just connecting two instances and configuring the details on the connection), or in the application graph for scoped connections.
See the respective chapter for the relation instance graph.
== Usage==Proxies ====Proxies can be designed in the proxy graph, which is very similar to the inheritance graph. You can use a context menu command to open the proxy graph for a meta class, if a proxy exists.Create a new proxy by dropping a meta class onto the proxy graph.See the respective chapter for the meta proxy graph.
=== Basic handling idea Application Graph ===In the middle of the screen, there is a worksheet that The [[Application Graph]] can be used to draw define what the project structure user can see on. Add new or existing models by dragging them from the pickers on the left of the screen to the worksheet area in the middlemobile device. Connect It's called "Application Graph" because the models using lines in order to define browsing hierarchy for the models' dependencies on each othermobile application is displayed graphically. When a model is selected, it One can be edited using inspector tools on the right define specific mobile versions of the screenMetaClasses (namely Scopes) as well as their properties and children with it.
The first step when using {{UBIK}} Smart Studio always is to open a project (or ==== App and Context ====You can create a new one). Then you can open an existing worksheet or create a new one reuse app and start modellingcontext objects to identify the view providing data to your satellites.LaterBelow a context, you can save your models to model the projectview hierarchy graphically using scopes and connections between them. Independent on the project, you The context can punctually save be configured with input queries for the current state of root and infrastructure objects. Just drag a worksheet (its "Situation") query onto the graph and connect it to the {{UBIK}} environment (database), if it is connectedcontext's respective input connector.
=== Organizing your work = Scopes ====In order A scope specifies what properties for instances of a meta class will be delivered to organize your work and to separate modelling from working directly the satellite. E.g., for pumps we might have many properties in the data base, but on the (productive) systemclient, there are Smart Projectswe require only two of them - this can be specified using meta class scopes. They serve as a container for your work and as You can specify whether it should be possible to create or delete instances on the scope.However, you can also use query scopes to provide an independent entity with interface to a query object on the possibility client. In order to punctually interact with create a query scope, hold {{UBIKkey press|Shift}} Environments (databases). This allows while dragging a query onto the user graph. Drop meta properties on a scoped query in order to transport (provide access to the query's properties and re-use) smart models between different {{UBIK}} Environmentsquery items.Meta query scopes are supported as well; dropping a query meta class on the graph will result in a respective scope.
=== Inheritance Graph and Application Graph = Connections ====There are two kinds of worksheets with different responsibilities: The [[Inheritance Graph]] allows In the user app graph, scopes can be connected hierarchically, in order to create meta models. It's called specify: "Inheritance GraphAs children for scope-A-objects, I want to see scope-B-objects" because the MetaClasses' inheritance structure is displayed graphically. The [[Application Graph]] Further, you can configure how the children should be resolved for a scoped connection - should a relation be used , or a link property on a child pointing to define what the user parent object?For query scopes, the outgoing connections are a bit simpler, because they can see on only target scopes that are compatible with the mobile device. Itquery filter class, and since the query delivers the children, there isn's called "Application Graph" t much to configure there. For meta query scopes, no outgoing connections are shown because we cannot anticipate what query will be used at design time. However, if you provide a fitting child scope to the browsing hierarchy context, it will be used for the mobile application is displayed graphically. One can define specific mobile versions children of MetaClasses (namely Scopes) as well as their properties and children with itqueries.
=== Bulk Editor ===
In order to modify potentially larger amounts of content instances conveniently, the [[SmartStudio Bulk Editor|Bulk Editor]] can be used. It shows all instances of a MetaClass in a table, extendable by derivates. The table rows are the instances, whereas the columns describe the meta properties. A single cell corresponds to the property value of a specific instance for a MetaProperty. As every other worksheet, the bulk editor can be used with data from a {{UBIK}} Environment. The results can be saved into the active project and/or back into the {{UBIK}} Environment.
The Bulk Editor supports multi-language values, sorting, filtering, grouping, drag & drop (also for multiple rows) and copy & paste (also for multiple target cells). Also, for the Bulk Editor, a multi-instance editor tool is available (similar to the inspector tool), allowing you to edit the values for mutliple multiple selected instances. A Bulk Editor worksheet can be exported to Excel using the respective context menu item. ==== Designing Queries ==== Queries can be designed using the Bulk Editor. You can use the context menu command "Convert to Query" in order to create a query for the meta class the bulk editor currently shows instances for. Then you can add Query Items by holding the {{key press|shift}} key while dragging column headers onto the query on the top left. The query items appear next to the query and can then be configured. === Custom Code ===You can customize the behavior of {{UBIK}} programmatically. There are multiple ways to do so:* React to life cycle events of objects (e.g., do something when an object is saved)* Override properties of objects (e.g., pre-process a value before it is assigned to a property)* Override methods of objects (e.g., evaluate the user rights for an object)* Add arbitrary custom code to a meta class* Create custom workflows * Create a custom code library to be used in the rest of the customizing {{UBIK}} SmartStudio provides rich code editors supporting IntelliSense and syntax highlighting based on Roslyn. For MetaClass related customizing, you can access such editors using the Behavior inspector tool (on the right hand side if you're using the default layout), when a MetaClass is selected in the Inheritance Graph. The custom code library can be maintained using a dedicated worksheet accessible via the "Behavior" menu.
=== Relation Target Bulk Editor ===
MetaProxies, their properties and their inheritance can be modeled and edited in the [[Meta Proxy Graph]]. A picker displaying all MetaProxies in the project and the {{UBIK}} Environment is available for choosing elements to display in the [[Meta Proxy Graph]] worksheet.
=== Project Smart Import: Comos meta data ===The Smart Model Import Worksheet can be used to import meta data XML files exported from Comos. The input is converted to Smart Models and opened in an Inheritance Graph Worksheet for further processing. One can also plan a semi-automatic import procedure, to make sure the import is processed safely and easily. After configuring the relevant steps, you will be guided through them as planned. Such a plan could be:* Show raw import data* Merge with Project data - Project wins in case of conflict (adjustable)* Save to Project* Merge with Environment data - Environment wins in case of conflict (adjustable)* Save to Environment* Finish importThe user can change the order of steps and switch them on or off.Further, the user can still do any actions manually, too. === Smart Import: Project model import ===
Sometimes it can be handy for a project engineer to let the customer fill in an Excel sheet listing all the MetaClasses and MetaProperties. The engineer then can extend the Excel configuration with details, including MetaProxies and ACM scope configurations. This Excel map can be imported by SmartStudio, using the Excel/OleDB Project Model Import Worksheet. The result of this import can be saved into the active project or the {{UBIK}} Environment, and inspected in various other worksheets if desired.
An important feature of this import worksheet is the configuration of column mappings (assignment of column names or indexes to something meaningful in UBIK, like the name of a MetaClass) and the automatic detection of erroneous column assignments.
=== Project page ===
Once a project is opened, there is a project page listing all the work sheets (e.g., Inheritance Graphs or Application Graphs) as well as all a [[Situation Editor]] giving you a detailed overview about the models in it contains as well as the projectpossibility to add or remove models, and to select a subset of the contained models and do something with it (e.g., retain only the selected models).
You can save a currently selected project using {{key press|Ctrl}} + {{key press|S}} or the save symbol in the tool bar.
However, make sure all the worksheets are saved to the project so you don't lose any data.
Worksheets like the Inheritance Graph or the Application Graph can be used to edit a part of the project. E.g., there could be two Inheritance Graph worksheets, each containing only a subset of the whole project. For example, you could model Pump meta classes on one worksheet and model Valve meta classes on another worksheet. Of course, you can also have a worksheet showing all the models at once, if you prefer it that way.
So, ==== Adding models to a project worksheet ==== Models can have multiple be selected and added to worksheets with overlapping content using Smart Studio's object pickers (i.ethe filterable, searchable and sortable list views to the left of the IDE), simply by dragging a model over to a worksheet and dropping it there.Alternatively, the [[Object Finder]] can be used to find and insert models into a worksheet. It is important to know that exist in multiple models can either originate from the connected {{UBIK}} Environment (database) or from the currently active project. We call that the "Source" of the model.Models from the project will always have a dashed border, whereas models from the {{UBIK}} Environment always have a solid border. You can remove models from the project (and all its worksheets)on the project page, or directly from a single worksheet. Changing In a worksheet , you can affect other worksheets after saving choose the change in order to keep consistency source (this happens automaticallyproject or environment)for a model. As a consequence, its details and dependencies will be updated and the model will be marked with the symbol for its source. ==== Saving Worksheets ==== Worksheets can be saved either to the connected {{UBIK}} Environment or to the currently active project. ===== ''Saving Worksheets to the Project'' ===== You can save a (selected) an active worksheet to the project using the confirm button (the icon is a hook/check symbol) in the tool bar, or using the "Save to Project" context menu item.This doesn't save the worksheet to the connected {{UBIK}} Environment.As soon as you save a worksheet to the project, all affected models in the saved worksheet will be marked as project models.
After saving the worksheet, the project will be marked as changed and can be saved using {{key press|Ctrl}} + {{key press|S}} or the save symbol in the tool bar, when the project page is selected.
Some operations A project can take a whilehave multiple worksheets with overlapping content (i.e., for example when a lot of data is loaded into models that exist in multiple worksheets). Changing a worksheet. Such tasks can be canceled using affect other worksheets after saving the stop symbol change in order to keep consistency (this happens automatically): the toolbar or {{key press|Esc}}worksheet content is propagated to all other worksheets (and to the project), so that your project situation is consistent.
==== Merging worksheets with = ''Saving Worksheets to the {{UBIK}} environment Environment'' ===== You can save an active worksheet to the currently connected {{UBIK}} Environment busing the "Save to {{UBIK}} Environment" toolbar button or context menu item.This doesn't save the worksheet to the project.The worksheet content will be saved to the database and the results will be shown in a new worksheet.Smart Studio's object pickers will be updated with the new models. ==== Merging Worksheets ====
Worksheets can originate from an import, from the project or from the environment.
Wherever it might have came come from, you can save the worksheet content to either the project or the environment.However, in some cases the worksheet content needs to be combined with what you already havein order to resolve conflicts.Currently, it ===== ''Merging worksheets with the {{UBIK}} Environment'' ===== It is possible to merge a worksheet with the environment Environment ({{UBIK}} database)using the context menu (right-click on the worksheet) or the respective toolbar icon.
The result is a combination between what you have defined in your worksheet and what the environment contains already regarding that situation.
In case of a conflict, normally the environment "wins". E.g., if you have a metaclass meta class A deriving from another metaclass meta class B in your worksheet, but the environment specifies C as a parent of A, the result of a merge would be A deriving from C. Using the inspector, you can specify whether a worksheet should override the environment on a merge. In that case, the merge result from the example above would be A deriving from B.
==== Merging worksheets The result of such a merge is not saved yet; you can edit it and decide what to do with it - e.g., save it to the SmartStudio project ====, save it to the environment or dismiss it.
New ===== ''Merging worksheets can be added to with the SmartStudio project by saving them. In this case, the worksheet content is propagated to all other worksheets (and to the project), so that your project situation is consistent.'' =====
=== Project models ===The project's models can be selected and added to worksheets using Smart Studio's object pickers.You can remove models from also merge a worksheet with the currently active project , without saving it, using the context menu (and all its worksheets) right-click on the project page, worksheet) or directly from the respective toolbar icon.The result is a single combination between what you have defined in your worksheet (using and what the inspector).project contains already regarding that situation,In case of a worksheetconflict, you can choose normally the source (project or environment) for a model"wins". As E.g., if you have a consequencemeta class A deriving from another meta class B in your worksheet, its details and dependencies will be updated and but the model will be marked with project specifies C as a parent of A, the symbol for its sourceresult of a merge would be A deriving from C. As soon as Using the inspector, you save can specify whether a worksheet to should override the projecton a merge. In that case, all affected models will the merge result from the example above would be marked as project modelsA deriving from B.
The result of such a merge is not saved yet; you can edit it and decide what to do with it - e.g., save it to the project, save it to the environment or dismiss it.
==== Cancelling active tasks ====
Some operations can take a while, for example when a lot of data is loaded into a worksheet. Such tasks can be canceled using the stop symbol in the toolbar or {{key press|Esc}}.
== {{UBIK}} Environment ==
Once a {{UBIK}} Environment is connected, the Smart Studio's object pickers provide all the models from the environment. These models can be used in work sheets. Worksheet situations can be saved to the {{UBIK}} Environment that is currently connected. Only one {{UBIK}} Environment can be connected at a time.
* Deploy the previously assembled ''Meta Definitions'' to all {{UBIK}} satellites via the web services (using the menu button or {{key press|F10}}) - don't forget to restart the web services to make sure the changes are applied correctly!
All commands depend on the previous commands (in the above order), for safety reasons.
== IDE ==
The IDE of {{UBIK}} Smart Studio was greatly inspired by Microsoft Visual Studio and similar development environments. This means that well-known and proven concepts, such as free docking of Tools, Documents and Controls is supported by Smart Studio and it's following the same usability principles.
=== Options ===
{{UBIK}} Smart Studio features a centralized Options center where all installed modules inject their configuration settings. By default, this can be reached through ''Tools → Options'', or, if the respective module supports it, from the context-menu of the module.
=== Tools ===
{{UBIK}} Smart Studio provides the following tools:
==== Pickers ====
Pickers are meant to provide certain objects for usage in other controls, so they mainly server as a Drag&Drop source during the engineering process.
{| class="wikitable sortable"
|-
! Picker !! Types to pick !! Target controls
|-
| Class Picker|| [[MetaClass|MetaClasses]]|| [[Inheritance Graph]], [[Application Graph]], [[Inspector]]
|-
| Property Picker|| [[MetaProperty|MetaProperties]]|| [[Inheritance Graph]], [[Application Graph]], [[Inspector]]
|-
| Classification Picker|| [[Classification|Classifications]]|| [[Inheritance Graph]], [[Application Graph]]
|-
| ACM Picker|| [[Application|Applications]] and [[Context|Contexts]]|| [[Application Graph]], [[Environment View]]
|-
| Selective Lists|| [[SelectiveList|Selective Lists]]|| [[Inheritance Graph]], [[Inspector]]
|-
| Query Picker|| [[Query|Queries]]|| [[Inheritance Graph]], [[Application Graph]], [[Inspector]]
|-
| Unit Picker|| [[UnitItem|Unit Items]]|| [[Inheritance Graph]], [[Inspector]]
|-
| Workflow Picker|| [[Workflow|Workflows]]|| [[Snippet Editor]]
|-
| RelationPicker|| [[Relation|Relations]]|| [[Inspector]]
|}
==== Object Finder ====
The [[Object_Finder]] is a tool for finding and using MetaClasses and Instances in your worksheets.
==== Error List ====
The Error List module shows notifications in the following categories
{| class="wikitable sortable"
|-
! Category !! Meaning
|-
| Error || Errors that occurred in the {{UBIK}} core or in the IDE of Smart Studio; should be reported to Support in any case!
|-
| Warning || Warnings that occurred in the {{UBIK}} core or in the IDE of Smart Studio; typically not critical for the operation of {{UBIK}}
|-
| Message || Informational messages
|-
| Database || Messages from the {{UBIK}} data layer
|-
| Service || Messages from the {{UBIK}} Web Services
|-
| Workflow || Messages from the {{UBIK}} Workflow Engine
|-
| Custom || Messages generated by customizing code
|}
==== Output ====
The Output tool shows debug and error messages in plain text format.
==== Immediate Window ====
The Immediate Window allows for scripting of C# code on the fly, without compilation; evaluation of the script happens as soon as the {{KeyPress|Enter}} key is pressed, but statements are also cumulative. This means that if e.g. the line <code>var a = SUIS.SelectedObject</code> is executed, the variable ''a'' is preserved for all subsequent statements and can therefore be used in the next lines; so the following statement <code>a.Name</code> will deliver a correct value.
== Useful tools ==
* [https://go.microsoft.com/fwlink/?linkid=2033947 SQLPackage]
If installed, SmartStudio uses this tool to export/import databases from and to SQL Servers and Azure databases
* [https://go.microsoft.com/fwlink/?linkid=2082695 SQLCmd]
If installed, SmartStudio uses this tool to modify SQL databases, e.g. for wizard-based imports
* [https://www.microsoft.com/en-us/download/details.aspx?id=48264 IISExpress]
If installed, SmartStudio uses this tool to spawn local WebServices for a full end-to-end testing experience