Object information

The business object information stage provides a very similar set of configuration options to the Process Info stage, plus some more.

Global Code

The global code section allows you to tie together the different pieces of code written in Code Stages across your business object.

Code written in the global code section forms a Microsoft VB.NET class. Functions and member variables declared here have scope across the entire business object, and may be referenced from a code stage. The methods declared in individual code stages are compiled into the same class and can be referenced from both the global code section and from other code stages.

If using a COM object, you will find it convenient to declare, instantiate, and dispose of it here, so that it retains state across several code stages.

The global code section allows you to reference external dynamic link libraries (dll files) and to declare class functions. This may be done by adding a row to the "External References" and browsing for the location of the external library.

When referencing Microsoft .NET class libraries (for example the System.Xml namespace), it is necessary to do two things. Firstly you must browse for the appropriate external reference and add it as per the instructions above. Secondly you must add a namespace import. For example when importing System.Xml.dll, you must add System.Xml to the namespace listview.

A choice of languages is available: Microsoft VB.NET or Microsoft C#.NET. Please refer to a Microsoft reference manual for a language specification of each language. After choosing your language you must use it consistently across all code stages within the current business object – you may not write some stages using one language and use a different language for another stage.

You may check the validity of your code (and all code stages) by pressing the "Check Code" button.

You can also set the runmode of the business object. The Run Mode of a process is determined by the most restrictive run mode of each of the business objects that it uses. A business object run mode can be one of Background, Foreground or Exclusive.

  • An exclusive process can not be run alongside any other process.
  • A foreground process can only be run alongside background processes, only one foreground process can be run at once.
  • A background process can be run with any other process, except exclusive processes.

Shared and shareable objects

Marking a business object as shareable allows its Application Model to be shared with other business objects. Business objects which share the model of another are known as shared.

When shareable or shared business objects are referenced multiple times they are able to interact with a single instance of the business object.

When Action stages are used within a process to reference actions within shared business objects, each call will be directed to a single instance of the model and associated application.

Example 1 – Single instance of a shared/shareable business object

The diagram below shows that the shareable object named Object C is referenced from a number of places using an Action stage. These include: the main process; within Object A; and within Object B. Because Object C is a shareable business object, only a single initialisation of the associated application occurs, then the Log In requested by Object A is also available for use by Object B.

 

If there is a requirement to launch a separate instance of a target application this can only be achieved through use of a sub-process if the business objects are configured with a shared application model.

Example 2 – Initiating multiple instances of a shared/shareable business object using a sub-process

The diagrams below show that irrespective of whether the automation root node is a process or an object a separate instance of the shareable/shared business object is provided within each sub-process.

The behaviour described above is in contrast to business objects which are not shared or shareable. Where business objects are not shareable/shared each use of an Action stage will result in a new instance of the model and associated application. This behaviour more easily supports scenarios where there is a requirement to have multiple instances of a given application, particularly where there is a desire to interact with them simultaneously.

Example 3 – Multiple instances of a non-shareable/non-shared business object

Example: The diagram below shows that each time that the non-shareable object named Object C is referenced using an Action stage, a separate instance of the object and associated application occurs. This means that the application Log In action requested by Object A is NOT available for use by Object B. In the example below, there would be three instances of Object C and the associated application.