Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Custom Workflow - **RESOLVED**

web-app

Hi,

I would like to create a custom action when transitioning to a particular state/status. Can this be accomplished within the workflow designer?

ie: Transition to "Closed" state will update a field on the current issue and email a notification to a user specified in a custom field.

yu217171
· 1
yu217171
Replies (18)
helpful
0
not helpful

This is not possible out of the box. However, you could write a plugin the will "listen" to the status change event and will do the work. Look at our twitter plugin for example: http://blogs.countersoft.com/index.php/2010/09/twitter-plug-in-refreshed/


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Hi Saar,

I can't find a code example or references to the API documentation on what interfaces to implement to enable event listeners.  Can you please provide me with a direct link to an example or documentation if it exists?


yu217171
· 1
yu217171
helpful
0
not helpful

Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Hi Saar,

Am I supposed to use Reflector to look at the code in the assemblies? I don't see any sample code in the zip file.


yu217171
· 1
yu217171
helpful
0
not helpful

My bad, see the 3.6 version: http://www.countersoft.com/Downloads/v36/CounterSoftGeminiPlugins_Twitter.zip (TwitterPlugin.cs file).


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Thanks Saar.

I have written my custom assembly. Do I just copy this to the "bin" folder of the Gemini web app?

using System; using System.Collections.Generic; using System.Text; using CounterSoft.Gemini.Commons; using CounterSoft.Gemini.Commons.Entity; using CounterSoft.Gemini.WebServices; using CounterSoft.Gemini.Commons.Rest;

namespace Company.Gemini.Plugins { public class IssueEventListener : AbstractIssueListener {

    private const string url = "http://gemini.domain.com";
    private const string userName = "domain\user";
    private const string apiKey = "xxxxxxxxxx";

    private ServiceManager serviceManager;

    public IssueEventListener()
    {
        InitializeServiceManager();
    }

    private void InitializeServiceManager()
    {
        serviceManager = new ServiceManager(url, userName, string.Empty, apiKey, false);
    }

    public override void IssueUpdated(IssueEventArgs args)
    {
        UpdateField(args);
    }

    private void UpdateField(IssueEventArgs args)
    {
        args.Issue.IssueLongDesc = "Updated from Event Listener";
        serviceManager.IssuesService.UpdateIssue(args.Issue);
    }
}

}


yu217171
· 1
yu217171
helpful
0
not helpful

Drop it to the plugins folder that is under the bin directory (create it if not there).
Note that you need to copy over all supporting DLLs (WebServices in your case).


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

I put all my referenced assemblies in bin\plugins. I put a bit of debugging code to write to the Event Viewer in the constructor but it doesn't seem to get hit.

Any other reasons that you can think of or something I simply missed?


yu217171
· 1
yu217171
helpful
0
not helpful

Please check Gemini's System Log for errors.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Hi Saar,

There are no error messages in the System Log after deploying the assembly into the \bin\plugins folder.


yu217171
· 1
yu217171
helpful
0
not helpful

Can you please send us your code (support at countersoft dot com)?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Email with source code sent. Thanks.


yu217171
· 1
yu217171
helpful
0
not helpful

We have just tested this and we can see errors in Gemini's system log (related to security and event logs).
Did you update an issue? Make sure that the folder name is plugins and put your dll and CounterSoft.Gemini.WebServices.dll in there.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

For testing purposes, the app pool identity is part of the local administrators group and has full access to the system. We don't see any errors in the Gemini system log. The same update code runs under the test harness using the REST web services. Is there some other configuration that I am missing? Perhaps, we can hold a quick LiveMeeting session to verify?


yu217171
· 1
yu217171
helpful
0
not helpful

Are you using windows authentication with Gemini (web)?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Yes, we are using Windows authentication and have disabled anonymous access.


yu217171
· 1
yu217171
helpful
0
not helpful

We may need to do a remote session as we tried it again with a full admin account and win auth and it works (well didn't change the url):
The remote name could not be resolved: 'geminiurl.com' at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) at CounterSoft.Gemini.WebServices.BaseService.GetResponse[T](String url, Object o, RequestType r) at CounterSoft.Gemini.WebServices.IssuesService.UpdateIssue(IssueEN issue) at TDBank.Gemini.Plugins.TDIssueEventListener.UpdateField(IssueEventArgs args) at TDBank.Gemini.Plugins.TDIssueEventListener.IssueUpdated(IssueEventArgs args) at CounterSoft.Gemini.Business.Events.GeminiEventDispatcher.PluginDelegateInvoker.<>cDisplayClass1.b0(Object func)

Please send an email to support at countersoft dot com and we will arrange day and time


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Just closing the loop on this issue as it has since been RESOLVED. Hopefully someone else can benefit from my experience.

The fix was to remove the following DLLs from the /bin/plugins folder.

-CounterSoft.Gemini.Commons.dll -Newtownsoft.Json.dll


yu217171
· 1
yu217171