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 { get; set; } public int age { get; set; } public string result { get; set; } public clsPerson(string name, int age, string 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<string> GetInputParameterKeys() { List<string> oList = new List<string>(); oList.Add("name"); oList.Add("age"); oList.Add("result"); return (oList); } public Type GetObjectType() { return (typeof(clsPerson)); } public List<string> GetDynamicPropertyList() { List<string> oList = new List<string>(); oList.Add("alpha"); oList.Add("beta"); return (oList); } public string GetDynamicPropertyValue(FWEngineContext oContext, string key) { return ("3"); } public bool SetDynamicPropertyValue(FWEngineContext oContext, string key, string val) { try { File.AppendAllText(@"c:\temp\eventdata\dyna.txt", oContext.BusinessObject.Name + " - " + key + " - " + val + Environment.NewLine); } catch { } return (true); } } }