Skip to content

Commit

Permalink
More updates to adv desktop ch 3 (custom transformers)
Browse files Browse the repository at this point in the history
  • Loading branch information
FMEEvangelist committed Dec 31, 2015
1 parent 6e2399b commit ed1a18a
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Custom Transformer Versioning

FME includes functionality so that a linked custom transformer can exist as a number of versions. In short, each time a custom transformer definition is edited, a new version can be saved.

In that way a single fmx file can contain multiple versions of the same custom transformer.


## Why use Versioning? ##

One advantage of versioning a custom transformer is that you have a record of previous versions and therefore can revert to a previous one should the need arise. For example, maybe some recent edits were incorrect and you need to switch back to the definition that existed before those edits were made.

However, a more important advantage relates to FME releases and new functionality.

For example, a custom transformer created in FME2015 and shared by many users could be updated to use new behaviour in FME 2016. If that custom transformer is versioned then the 2015 version remains available to users who have yet to update to that version of FME; while users who have updated their FME can also update their custom transformer to take advantage of the new updates.


## Creating a Versioned Custom Transformer ##

Versioning can occur when you edit a linked custom transformer definition (usually an unversioned one) and then attempt to save it. In that situation a dialog will open to ask what you wish to do:

![](./Images/Img3.40.CreateNewCTVersion.png)

The two options are to overwrite the existing version or to create a new version. Creating a new version does not create a separate fmx file; instead it creates a separate version of the transformer in the same fmx file.

The title bar in Workbench also changes to illustrate that this is now a new version.

![](./Images/Img3.41.NewCTVersionWBHeader.png)

---

<table style="border-spacing: 0px">
<tr>
<td style="vertical-align:middle;background-color:darkorange;border: 2px solid darkorange">
<i class="fa fa-quote-left fa-lg fa-pull-left fa-fw" style="color:white;padding-right: 12px;vertical-align:text-top"></i>
<span style="color:white;font-size:x-large;font-weight: bold;font-family:serif">First Officer Transformer says…</span>
</td>
</tr>

<tr>
<td style="border: 1px solid darkorange">
<span style="font-family:serif; font-style:italic; font-size:larger">
Subsequent saves don’t update the version number. A new version is only created for a new edit session; i.e. the first time you save the transformer after it is newly opened in Workbench. If you keep on making edits, it just saves to the same version. You need to close and reopen the file to create another new version.
</span>
</td>
</tr>
</table>

---

## Editing a Specific Transformer Version ##

Whenever a versioned custom transformer is initially opened in Workbench, you are prompted as to which version you wish to edit, or whether you want to just start with a new version:

![](./Images/Img3.42.CTEditingVersionChoice.png)

This way you are able to:

- Create a new version to make edits to
- Continue making edits to the existing version
- Make edits on an older version (particularly useful when that version is tied to a particular FME release)


## Updating a Transformer Version ##

Whenever a workspace contains a linked custom transformer, you get the same version information (in summary annotation and the like) as a regular transformer:

![](./Images/Img3.43.CTVersionSummaryAnnotation.png)

However, if FME detects that a new version is available, then an option appears on the context menu to allow an update to the new version:

![](./Images/Img3.44.CTNewVersionAvailable.png)

Choosing to upgrading means the summary annotation would display the newest version number.

---

<table style="border-spacing: 0px">
<tr>
<td style="vertical-align:middle;background-color:darkorange;border: 2px solid darkorange">
<i class="fa fa-quote-left fa-lg fa-pull-left fa-fw" style="color:white;padding-right: 12px;vertical-align:text-top"></i>
<span style="color:white;font-size:x-large;font-weight: bold;font-family:serif">Miss Vector says…</span>
</td>
</tr>

<tr>
<td style="border: 1px solid darkorange">
<span style="font-family:serif; font-style:italic; font-size:larger">
What do you think would happen in this scenario? You have a workspace with a linked custom transformer (version 1). The author of that transformer makes a series of edits and updates it to version 4. What will the upgrade option do to the custom transformer in your workspace?
<br><br>1. Upgrade it to version 2
<br>2. Upgrade it to version 3
<br>3. Upgrade it to version 4
<br>4. It depends on what version of FME you and the author are using
</span>
</td>
</tr>
</table>


25 changes: 25 additions & 0 deletions DesktopAdvanced3CustomTransformers/3.99.QuestionAnswers.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,28 @@ Can you nest custom transformers? That is, can you put one custom transformer in
</tr>
</table>

---

<!--Person X Says Section-->

<table style="border-spacing: 0px">
<tr>
<td style="vertical-align:middle;background-color:darkorange;border: 2px solid darkorange">
<i class="fa fa-quote-left fa-lg fa-pull-left fa-fw" style="color:white;padding-right: 12px;vertical-align:text-top"></i>
<span style="color:white;font-size:x-large;font-weight: bold;font-family:serif">Miss Vector says...</span>
</td>
</tr>

<tr>
<td style="border: 1px solid darkorange">
<span style="font-family:serif; font-style:italic; font-size:larger">
You have a workspace with a linked custom transformer (version 1). The author of that transformer makes a series of edits and updates it to version 4. What will the upgrade option do to the custom transformer in your workspace?
<br><br><span style="color:lightslategrey">1. Upgrade it to version 2</span>
<br><span style="color:lightslategrey">2. Upgrade it to version 3</span>
<br><span style="color:lightslategrey">3. Upgrade it to version 4</span>
<br><span style="font-weight:bold">4. It depends on what version of FME you and the author are using</span>
<br><br>It will upgrade the custom transformer to the latest version that is compatible with the FME version you are using. If you are using the same version of FME, then it would upgrade the custom transformer to version 4. But if you are using different versions of FME then it could be version 2 or 3 instead (or maybe there would be no available updates at all!)
</span>
</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -1,58 +1,3 @@
# Custom Transformer Versioning

FME includes functionality so that any single custom transformer can exist in a number of versions.

**Why use Versioning?**

Versioning means a single custom transformer can exist in any number of versions.

One advantage of versioning a custom transformer is that you have a record of previous versions and therefore can revert to a previous one should the need arise.

However, a more important advantage relates to FME releases and new functionality.

For example, a custom transformer shared by many users could be updated to use new behaviour in FME 2015. If that custom transformer is versioned then the previous version remains available to users who have yet to update to 2015, while users who have updated to FME2015 can update their custom transformer to match.

**Creating a Versioned Custom Transformer**

Versioning can occur whenever you edit a linked custom transformer and then attempt to save it. In that situation a dialog will open to ask what you wish to do:

The two options are to overwrite the existing version or to create a new version. Creating a new version does not create a separate fmx file; instead it creates a separate version of the transformer in the same fmx file.

The title bar in Workbench also changes to illustrate that this is now a new version.

<table style="border-spacing: 0px">
<tr>
<td style="vertical-align:middle;background-color:darkorange;border: 2px solid darkorange">
<i class="fa fa-quote-left fa-lg fa-pull-left fa-fw" style="color:white;padding-right: 12px;vertical-align:text-top"></i>
<span style="color:white;font-size:x-large;font-weight: bold;font-family:serif">First Officer Transformer says…</span>
</td>
</tr>

<tr>
<td style="border: 1px solid darkorange">
<span style="font-family:serif; font-style:italic; font-size:larger">
“Subsequent saves don’t update the version number. A new version is only
created for a new edit session; i.e. the first time you save the transformer
after it is newly opened in Workbench.”
</span>
</td>
</tr>
</table>

**Editing a Specific Transformer Version**

Whenever a versioned custom transformer is initially opened in Workbench, you are prompted as to which version you wish to edit, or whether you want to just start with a new version:

This way you are able to make edits on older versions, which is particularly useful when that version is tied to a particular FME release.

**Updating a Transformer Version**

Whenever a workspace contains a linked custom transformer, and FME detects that a new version is available, then an option appears on the context menu to allow an update to the new version:

If you have the ‘Show Transformer Version’ option turned on under Tools > FME Options > Transformers, then the tooltip will now show the transformer version:

Note that if I was using a version of FME that is incompatible with the updates in version 2, then I would not be given the option to update.

I notice that there’s a custom transformer to calculate the average area of a number of polygon features. But there’s no such transformer to calculate the average length of linear features.

Let’s fix that situation by creating such a transformer.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ed1a18a

Please sign in to comment.