Difference between revisions of "HowTo:Create UBIK Workflow Activity Plugin"
(→See also) |
|||
Line 54: | Line 54: | ||
== See also == | == See also == | ||
+ | * [[Injection_Management]] | ||
* [http://msdn.microsoft.com/en-us/library/823z9h8w%28v=vs.110%29.aspx <probing> Element on MSDN] | * [http://msdn.microsoft.com/en-us/library/823z9h8w%28v=vs.110%29.aspx <probing> Element on MSDN] | ||
[[Category:Workflow]] | [[Category:Workflow]] | ||
[[Category:How-To]] | [[Category:How-To]] |
Revision as of 12:04, 19 March 2015
You can add new workflow activities to your UBIK® system via plugins loaded by the Injection Management.
Prerequisites
The new activity needs to be placed in an UBIK® plugin which has to implement the interface UBIK.WorkflowBase.IUBIKActivity and inherit from System.Activities.NativeActivity<T>. The interface is located in the UBIK.WorkflowBase which has to be referenced therefore.
Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.ComponentModel;
using System.ComponentModel.Composition;
using UBIK.Kernel;
using UBIK.WorkflowBase;
namespace UBIK.Interface.Module.PluginExamples
{
/// <summary>
/// Sends a message to UBIK.Compiler.Debugger
/// </summary>
[UBIK.WorkflowBase.Attributes.Category("UBIK Plugins")]
[Export(typeof(UBIK.Injection.IUbikPlugin))]
[ExportMetadata("ID", "C149402E-BC86-46D6-8D1B-63C86894EA77")]
[ExportMetadata("Type", typeof(TestActivity))]
[ExportMetadata("Name", "TestActivity" )]
[ExportMetadata("Description", "WF Activity: Sends a message to UBIK.Compiler.Debugger")]
[ExportMetadata("Version", 1)]
[ExportMetadata("Company", "Augmensys GmbH")]
[ExportMetadata("Copyright", "2015, Augmensys GmbH")]
public class TestActivity : NativeActivity<string>, UBIK.Injection.IUbikPlugin, UBIK.WorkflowBase.IUBIKActivity
{
public InArgument<BaseClass> UBIKObject { get; set; }
public InArgument<string> Text { get; set; }
protected override void Execute(NativeActivityContext context)
{
BaseClass bc = this.UBIKObject.Get<BaseClass>(context);
string txt = this.Text.Get<string>(context);
UBIK.Compiler.Debugger.Output(this, txt);
this.Result.Set(context, txt);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.ComponentModel;
using System.ComponentModel.Composition;
using UBIK.Kernel;
using UBIK.WorkflowBase;
namespace UBIK.Interface.Module.PluginExamples
{
/// <summary>
/// Sends a message to UBIK.Compiler.Debugger
/// </summary>
[UBIK.WorkflowBase.Attributes.Category("UBIK Plugins")]
[Export(typeof(UBIK.Injection.IUbikPlugin))]
[ExportMetadata("ID", "C149402E-BC86-46D6-8D1B-63C86894EA77")]
[ExportMetadata("Type", typeof(TestActivity))]
[ExportMetadata("Name", "TestActivity" )]
[ExportMetadata("Description", "WF Activity: Sends a message to UBIK.Compiler.Debugger")]
[ExportMetadata("Version", 1)]
[ExportMetadata("Company", "Augmensys GmbH")]
[ExportMetadata("Copyright", "2015, Augmensys GmbH")]
public class TestActivity : NativeActivity<string>, UBIK.Injection.IUbikPlugin, UBIK.WorkflowBase.IUBIKActivity
{
public InArgument<BaseClass> UBIKObject { get; set; }
public InArgument<string> Text { get; set; }
protected override void Execute(NativeActivityContext context)
{
BaseClass bc = this.UBIKObject.Get<BaseClass>(context);
string txt = this.Text.Get<string>(context);
UBIK.Compiler.Debugger.Output(this, txt);
this.Result.Set(context, txt);
}
}
}