03-02-2016 02:17 AM
Hallo,
I would like to create an URL trigger for the workflows in Geomedia Smart Client. I was told that the source code yet exists. Could anyone post the source code here?
Best regards
Mario
03-02-2016 08:32 AM
Hi,
could you please elaborate more what you need? Is it a custom trigger you are talking about? What do you need to implement in such a trigger?
Thanks,
Stefano
03-03-2016 01:52 AM
Hallo Stefano,
I think it is a custom trigger that performs a simple 'clic' on an URL.
The workflow settings should look like this:
<WorkflowTrigger name="SIGNOFF" type="UrlTrigger" method="action">
<Param name="Url" value="http://server/CadService/LogoffEmployee?empid={REQUESTCONTEXT.empid}"/>
</WorkflowTrigger>
I was told that for this operation the sourcecode yet exists.
Could you post in here such an example?
Best Regards
Mario
03-03-2016 03:10 AM
Hi Mario,
you need to create a .NET class libary and reference the following assemblies in your project:
Add a new class to your project and name it "UrlTrigger".
To create a custom workflow trigger you need to inherit from WorkflowTriggerBase and override the Execute method.
using Intergraph.Emea.Workflows; using Intergraph.Emea.Core; namespace SampleTriggers { [ExtensibleType("UrlTrigger")] public class UrlTrigger : WorkflowTriggerBase { public string Url { get; set; } public override void Execute() { using (HttpClient client = new HttpClient()){ using (HttpResponseMessage response = await client.GetAsync(Url)){ using (HttpContent content = response.Content) { //todo: do something with the response if needed } } } } } }
This is a simple code for your needs.
In order to use your custom trigger, you need to place your assembly in the bin folder.
Regards,
Azzurra