Jump to: navigation, search

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


Line 1: Line 1:
You can add new workflow activities to your {{UBIK}} system via the Injection Management interface.
+
You can add new workflow activities to your {{UBIK}} system via a plugin used by the Injection Management interface.
  
 
== Prerequisites ==
 
== Prerequisites ==
The new activity needs to be placed in a UBIK plugin.
+
The new activity needs to be placed in a UBIK plugin which should implement the interface '''UBIK.WorkflowBase.IUBIKActivity'''.
 +
Although there is no technical need for it we recommand that every activity should at least implement this interface.
  
== Workflow ==
+
The interface is located in the '''UBIK.WorkflowBase''' which has to be referenced therefor.
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:

Revision as of 14:54, 16 February 2015

You can add new workflow activities to your UBIK® system via a plugin used by the Injection Management interface.

Prerequisites

The new activity needs to be placed in a UBIK plugin which should implement the interface UBIK.WorkflowBase.IUBIKActivity. Although there is no technical need for it we recommand that every activity should at least implement this interface.

The interface is located in the UBIK.WorkflowBase which has to be referenced therefor.

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);
        }
    }
}
IC Attention.pngThe injection of workflow activities is only supported if the plugin is placed within Injection under the UBIK installation directory. Make also sure this folder is configured as probing path in the config file.

See also