Jump to: navigation, search

Difference between revisions of "HowTo:Create UBIK Workflow Activity Plugin"


m
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Prerequisite ==
+
New workflow activities can be injected into {{UBIK}} using the [[Injection_Management|Injection Management]]. The plugin needs be implement the interface '''UBIK.WorkflowBase.IUBIKActivity''' and inherit from '''System.Activities.NativeActivity<T>'''. The interface <code lang="csharp">IUBIKActivity</code> is located in the library '''UBIK.WorkflowBase.dll'''.
If you want to add a UBIK Workflow Activity via the UBIK Injection Interface to UBIK your Activity needs to be a UBIK Plugin.
+
[[Create_UBIK_Plugin|See here how to create your own Plugin]].
+
 
+
== Workflow ==
+
Further more your Plugin should implement the Ubik UBIK.WorkflowBase.IUBIKActivity (but there is no technical need to do it).
+
Therefor, you need a reference to UBIK.WorkflowBase.
+
 
+
Example:
+
  
 +
= Example =
 
<source lang="csharp">
 
<source lang="csharp">
 
 
using System;
 
using System;
 
using System.Collections.Generic;
 
using System.Collections.Generic;
Line 52: Line 44:
 
     }
 
     }
 
}
 
}
 +
</source>
  
 +
<headertabs/>
  
</source>
+
== See also ==
 
+
* [[Injection_Management]]
{{Attention|The injection of WF Activities is only supported via the UBIK Installation Injection Folder. Make sure this folder is configured as probing path in the config file*.}}
+
* [[HowTo:Create_UBIK_Plugin]]
[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:How-To|Create UBIK Workflow Activity Plugin]]
[[Category:How-To]]
+
[[Category:Workflow|Create UBIK Workflow Activity Plugin]]
 +
[[Category:Plugin|Create UBIK Workflow Activity Plugin]]

Latest revision as of 12:04, 3 August 2016

New workflow activities can be injected into UBIK® using the Injection Management. The plugin needs be implement the interface UBIK.WorkflowBase.IUBIKActivity and inherit from System.Activities.NativeActivity<T>. The interface IUBIKActivity is located in the library UBIK.WorkflowBase.dll.

[edit]

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);
        }
    }
}

See also