What is a Business Object?
Implementing business objects with cDevWorkflow
A cDevWorkflow business object (BO) is an object that provides design and runtime integration with API-accessible elements of other applications. cDevWorkflow business objects are implemented using the “deIBusinessObject” interface. Business objects are configured with a class name, namespace and their DLL file name. Once configured, these business objects become available within the workflow designer and can be used to get and set their BO property values in workflow processes. By using the “getBusinessObject” step, the business object can be retrieved at runtime and its properties used within other workflow logic. For example, if a “Person1” BO has a property called “age”, this “age” property can be referenced within a “Decision” step evaluation statement: int.Parse(“cDevBO.Person1.age”) == 15
Writing a custom Business Object
A custom BO can be implemented using the interface “deIBusinessObject”. Below is sample code for clsPersonBO business object.
Configuring the Business Object
Once the custom business object is compiled, place the DLL file in the cDevWorkflow’s “bin” folder and use the Auto Detect feature to configure it.
Using the Business Object within a Workflow process
First, make sure the above described “clsPeronBO” object has been configured within the Business Objects section of cDevWorkflow’s Configuration Manager. Create a new Workflow Definition called “TestBO Def”. Next, open the new “TestBO Def” definition within the graphical designer. Using the designer toolbar button “Manage Business Objects”, let’s define a business object to be used within the process. Manage Business Objects UI will render within the right pane as follows: Let’s create a process level Business Object called “Person1” that is type “clsPersonBO”. Now that the Business Object is defined, we can use it within the process. Add a “getBusinessObject” step to the workflow design and connect it to the “start” step. Click the “getbusinessobject” step to configure its properties: You can also configure properties such as the time to live (ttl) and whether to load properties on demand for the business object. If ttl is configured, the business object will automatically update itself after the expiration period. For example, if the BO has an expiration of 10 minutes, whenever the workflow runtime accesses that business object it will check to see if the BO property values have been retrieved from the source system within the last 10 minutes. If the ttl has expired, the BO will refresh itself automatically to provide the latest information to the process.Since our sample BO has a property called “age”, let’s use that property to make a decision. Add a “decision” step to the designer canvas and connect it to the “getbusinessobject” step. Let’s use the decision step to figure out if Person1.age is greater than 18 years. Click the “decision” step and configure the properties as shown below. Save the changes to the definition so that it is ready to execute. Navigate to the Workflow Instances menu item and create a new Instance, selecting definition “TestBO Def” and entering an instance name. Once the Instance is created, select the Instance and execute it. Once execution is complete, the Instance should have a status of “finish”. Click the “Render” button on the toolbar to render the executed Instance. The rendered Instance will look as follows: Click the “check age is > 18” step to drill down into the step information. The decision step should render as follows: As we can see in the above graphic, the decision step evaluated the expression ‘int.Parse(“cDevBO.Person1.age”) > 18’ and returned a value of “True” for the return value of the step. Click the “Properties” button to view the properties for the step. Click the icon next to the condition to view the expression with BO replacement values: You may also be interested in reading more on the subject of Configuring a Custom Workflow Step.A small sampling of the Workflow Technology for BPM Solutions contained within our cDevWorkflow product offering can be found here: Workflow Technology That Works.
Leave a Comment
You must be logged in to post a comment.