How To Build & Configure A Business Object

Lean to build and configure a business object

Last published at: July 30th, 2024

What is a Business Object?

FlowWright business object (BO) is an object that gives real-time access to business objects from other systems/applications.  Think of it as a proxy for business objects.  Business objects are implemented using a simple interface, “FWBusinessObject.” 

Watch the following video on creating and using a business object in a process.

 

 

Here's the code from the example:

namespace FW10CustomItems
{
    public class clsPerson
    {
        public string name { getset; }
        public int age { getset; }
        public string result { getset; }
 
        public clsPerson(string nameint agestring result)
        {
            this.name = name;
            this.age = age;
            this.result = result;
        }
    }
}
using FlowWright.Engine;
using System.Collections;
 
namespace FW10CustomItems
{
    public class FWPersonBO : IFWBusinessObject
    {
        public object GetObject(FWEngineContext oEngineContext, Hashtable oInputParameters)
        {
            clsPerson oPerson = new clsPerson(oInputParameters["name"].ToString(), int.Parse(oInputParameters["age"].ToString()), oInputParameters["result"].ToString());
 
            return (oPerson);
        }
 
        public List<stringGetInputParameterKeys()
        {
            List<stringoList = new List<string>();
 
            oList.Add("name");
            oList.Add("age");
            oList.Add("result");
 
            return (oList);
        }
 
        public Type GetObjectType()
        {
            return (typeof(clsPerson));
        }
 
        public List<stringGetDynamicPropertyList()
        {
            List<stringoList = new List<string>();
 
            oList.Add("alpha");
            oList.Add("beta");
 
            return (oList);
        }
 
        public string GetDynamicPropertyValue(FWEngineContext oContextstring key)
        {
            return ("3");
        }
 
        public bool SetDynamicPropertyValue(FWEngineContext oContextstring keystring val)
        {
            try
            {
                File.AppendAllText(@"c:\temp\eventdata\dyna.txt", oContext.BusinessObject.Name + " - " + key + " - " + val + Environment.NewLine);
            }
            catch { }
 
            return (true);
        }
    }
}