Online Help | Desktop App

Create Object

A Create Object operation creates a new object or multiple objects and perform any operations on newly created objects. New objects may be related to the current object or not.

You first choose which objects to create, and then optionally add operations to be invoked on the newly created objects. So, Create Object operations are effectively "anonymous" functions that can contain other operations like Update Field, E-mail Notification, etc.

To configure a Create Object operation:

  1. In the Select Object Class window, double-click the class of objects to create. The Create Object window opens.

  2. In the Relationship list, select the relation between the current and the target objects:

    • If the target object has a direct relation with the current object via various object’s attributes, select that relation under An attribute of the current object.

    • If the target object is related to the current object on the object’s Related Objects tab, select the relationship type under A related object (shown on the Related Objects tab).

      NOTE: For details on relationship types, see Object Relationships.

    • If your target object has no relation with the current object, select No relationship.

  3. Under Template, choose a Template if you want to assign initial values to the target object's fields:

    • Click Select and select a Template from the list of Templates for the object class.

  4. By default, the operation creates a single object. If you want to create multiple objects at once, specify their quantity in the Object Count field. To define an expression to be calculated at runtime, click the Expression Builder button to bring up the Build Expression window. Your SQL expression must return an integer value.

  5. When you use the operation in an interactive Action (in a Create Action or a Step Action), you may want to let the user view the automatically created object. To open newly created object (or objects) after the user completes the Action, select the Open created object when action is executed interactively check box.

  6. You can control whether the Triggers on the created object are fired when the operation is executed. To fire those Triggers, select the Execute triggers on created objects check box.

  7. Click OK. The CREATE Object ($Object) and END CREATE rows appear in the list of operations. The CREATE node is empty, meaning that your operation just creates the object or multiple objects.

    NOTE: The $Object identifier will help you identify the created object in nested Create Object and Act on Related Object operations. For details, see Using automatic variables.

  8. If you want to invoke other operations on newly created objects, right-click the CREATE Object ($Object) row and choose New > [Operation] from the pop-up menu. For instructions, see Adding workflow operations. By default, operations run unconditionally, but you can configure conditional statements if needed.

IMPORTANT: Unlike direct operations on the current object, all operations in the CREATE node are executed on the newly created object.

Once you add Create Object operations, Alloy Navigator makes available automatic variables. For details, see Using automatic variables.