The extension is deprecated and this page is accessible only for historical reasons.
Please do not try to download and/or contact us regarding this extension.
Execute custom logic on every field change of a Work Item
++What it does++
This Plugin enables the possibility to execute custom logic on every field change of a Work Item.
Basically it is only possible to execute workflow actions when changing the status of a Work Item. With
this Plugin you could simply execute all of your workflow actions at a special field change.
It enables a lot of new possibilities. For example you could change the priority automatically to "highest" if
the severity was set to "Blocker".
++Conditions++
Writing a own extension which is using this Plugin is only advisable for users which have already created
custom workflow functions which are executed at a Work Item status change!
You need to have a Eclipse Installation with a local integrated Polarion Installation. It is a requirement to create
workflow functions for Polarion at all.
For setting up such a workspace you have to refer to Polarion SDK document "sdk.pdf" which is located in
"$POLARION_INSTALL_PATH/polarion/SDK/doc"
++How to install++
Copy the directory "com.polarion.technisat.plugin.pop.savehook" of the extension to
# $POLARION_INSTALL_PATH/polarion/plugins/
If you want to start directly with the example extension which uses the SaveHook extension copy the direcory "com.company.myplugin_1.0.0" to
# $POLARION_INSTALL_PATH/polarion/plugins/
To get your new extension executed with the SaveHook plugin you have to open the file:
# $POLARION_INSTALL_PATH/polarion/plugins/com.polarion.technisat.plugin.pop.savehook/config/plugin.properties
and add the line
externalplugins=com.company.myplugin
If the property "externalplugins" was already set with another plugin just add
"com.company.myplugin" with a seperating ",":
externalplugins=com.polarion.technisat.savehook.fieldchange, com.company.myplugin
Now you have to reboot your Polarion service and change the severity of a defect Work Item to "Blocker" and click on "Save".
The priority should be automatically set to "highest".
If you want to disable the sample extension you have to remove the string "com.company.myplugin" in the
# $POLARION_INSTALL_PATH/polarion/plugins/com.polarion.technisat.plugin.pop.savehook/config/plugin.properties
file
If you want to create an extension on your own read the following chapters.
++How to create a new Extension++
The created example extension in this chapter is also avaiable as a complete Eclipse project. You could simply import it to your workspace.
To create a new extension which gets executed on a special field change you have to perform following steps.
Some of them are just the same when you create a new work flow plugin. But I will explain each step anyway.
- In Eclipse create a new Polarion Extension "File->New->Plugin-in Project"
- Insert a project name (e.g. com.company.myplugin) and click on "Next"
- REMOVE the ".qualifier" string in the "Version" input field and REMOVE the check near
"Generate an activator, a Java class that controls the plugin-in's life cycle."
You have to set the input field later. But make sure that you do not set the check again!
- Click on finish.
- Open the created project directory in Windows file system explorer and create a directory "lib" and copy the file
"plugininterface.jar" (could be found within SaveHook extension) to the "lib" directory.
- Go back to Eclipse and right click you created project and click on "Refresh". The new-created directory should
be visible now.
- Open the "META-INF/MANIFEST.MF" file in Eclipse and choose the chapter "Overview" at the bottom.
- Remove the content of "Execution Environment".
- Select the chapter "Dependencies" and add "com.polarion.alm.tracker" in "Required Plugin-ins"
- Select the chapter "Runtime" and click on "New..." and create a new library of your extension. E.g. "MySavePlugin.jar".
After that click on "Add..." and select "lib/plugininterface.jar" and click on "OK".
- Remove the "." entry.
- In your plugin project create a new package in the "src" directory (e.g com.company.myplugin.main) and
in this package create a new Java class (e.g. ExecuteSomething.java). Add in chapter "Interfaces" the file
"ICustomSavePlugin" (you have to type ICustom... to see something).
- Open the "META-INF/MANIFEST.MF" file again, select "Overview" chapter and select at the point "Activator"
the just created Java class (ExecuteSomething.java). Make sure that you have REMOVE the check near
"Generate an activator, a Java class that controls the plugin-in's life cycle."
- The implemented "init" method defines parameters "status" and "field" to decide under which conditions the
"run" method should be executed.
- The implemented "run" method executes the business logic.
++Interface Documentation++
Interface IPluginSettings:
// Defines the status for which the extension should be executed
// Leave it empty for all status values
public void setStatus(String status)
// Defines the field which has to be changed to get the extension executed
public void setField(String field)
Interface IPluginSettings:
// Returns the Polarion IWorkitem interface of the work item which is currently saved
public IWorkitem getCurrentWorkItem()
++Integrate Extension into SaveHook Plugin++
Export the created extension to your Polarion installation:
- In Eclipse right click on the project name of the extension (e.g. com.company.myplugin) and select "Export".
- Choose "Deployable Plug-ins and Fragments".
- Click on "Finish".
To get your new created extension executed with the SaveHook plugin you have to open the file:
# $POLARION_INSTALL_PATH/polarion/plugins/com.polarion.technisat.plugin.pop.savehook/config/plugin.properties
and add the line
externalplugins=com.company.myplugin
If the property "externalplugins" was already set with another plugin just add
"com.company.myplugin" with a seperating ",":
externalplugins=com.polarion.technisat.savehook.fieldchange, com.company.myplugin
Now you have to reboot your Polarion service and change the severity of a defect Work Item to "Blocker" and click on "Save".
The priority should be automatically set to "highest".
++Help++
- If there are any questions please write me an e-mail to s.frenzel@technisat.de
++Tested on Polarion 2012++
- This extensions hasbeen not tested earlier versions of Polarion.
++Limitations++
At the moment the extension only executes other exensions when _saving_ a Work Item and not at _creation_.
The next version of this extension will support also the possibility the execute custom code when a Work Item
is created.
++Special Thanks++
A special thanks go out to Benjamin Engele for pointing out the possibilty to "hook" into the "save" method of Polarion and my colleague Robert Kirschner for testing this extension and solving errors.
Sandro Frenzel
TechniSat Digital GmbH