Syntax
Adding Legacy DataIf you are adding legacy data from external systems into the database, three clauses are provided to migrate and synchronize the data. The Current clause of the Add Businessobject is used to create business objects that are already beyond the first state of their policies. The Originated clause of the Add Businessobject command is used to maintain origination dates from the legacy system. Lastly, the Modified clause of the Add Businessobject command is used to maintain modification dates from the legacy system. If you are migrating legacy data without these clauses, see Modifying Legacy Data. Policy ClauseThis clause assigns a policy to the business object. A policy controls a business object. It specifies the rules that govern access, approvals, lifecycle, versioning and revisioning capabilities, and more. If there is any question as to what you can do with a business object, it is most likely answered by looking at the object’s policy. Specifically, a policy defines the following information:
Since this information is required for a business object to be usable, a Policy clause must be included in the business object definition. If you are unsure about the policy, you should examine the policy definition with the Print Policy command (for more information, see MQL Concepts: Policies). The policy specified must be defined to govern the type of business object being created. If the policy name you give in this clause is not found, an error message results. If that occurs, use the List Policy command to check for the existence and spelling of the policy name. For example, the following object definition assigns the “Software Development” policy to a business object titled “Graphics Display Routine:”
After this command is processed, the business object will be created and the “Software Development” policy will control who can access the object and the object’s lifecycle states. Image ClauseThis clause associates a special image, called an ImageIcon, with a business object. While it is optional, it can assist a user in locating a desired object. For example, you could have several different components, blueprints, or designs within a vault. By having an ImageIcon of each item associated with its object name, a user can easily locate the object s/he desires by using the associated ImageIcon as a guide. Note:
Web
apps
do not use this image.
While ImageIcons are very similar to icons, they require more display time and probably should be displayed only at specific times. Also, while an icon is associated with items such as policies, types, and formats, ImageIcons are associated only with objects and persons. An object might or might not have an ImageIcon associated with it. Excluding an ImageIcon from this object will not affect other objects that are created with the same type, policy, state, and owner. You can even have two revisions of an object with different ImageIcons since each revision represents a different object. The GIF file needs to be accessible only during definition using the Add or Modify Businessobject command. Once an accessible file in the correct image type is used in the Businessobject command, 3DSpace will read the image and store it with the object definition in the database. Therefore, the physical icon files do not have to be accessible for every session. (If the file is not accessible during definition, 3DSpace will be unable to display the image.) To write an Image clause, you need the full directory path to the ImageIcon you are assigning. For example, the following command assigns an ImageIcon of the actual vehicle to the business object:
Specifying redundant icons adds redundant information in the database that requires more work to display. When the default icon is desired, do not specify it. The Image clause of the Add Businessobject command is optional unless there is a need to distinguish between objects of the same type. If you do not specify an image, the default icon of the type is used. If you associate an image with a business object using the Image clause, you can retrieve the image as a GIF file using the Image command. The GIF file is placed in the ENOVIA_INSTALL directory, unless overridden by the optional clause, directory.
For example:
This command retrieves the image of object Assembly 12345 0 and saves
it to the
Vault ClauseThis clause specifies the name of the vault where the object will reside. If you include a Vault clause in your definition, it must be placed after the Policy clause and before any other Add Businessobject clauses. 3DSpace must know which vault is associated with the business object. This element is optional because if not explicitly stated. The current vault (as set in the current context) is a default value. If the object you are creating should not be in the current vault, you must include the vault’s name in the object’s definition. For example, assume you are in a vault named “Car Loans.” You decide to create an object with the specification “Car Loan” “Alan Broder.” You could do this by entering the following command:
Since a vault is not specified, the current vault, “Car Loans,” is used to store the business object named “Alan Broder.” But what if Mr. Broder also had a mortgage with the same company and you were in the “Mortgages” vault instead of the “Car Loans” vault? You would have to include a Vault clause:
In many ways, vaults resemble and operate like directories on computers. Your context is similar to your default directory. If the object (like a file) is not in the default directory, you must include the directory as part of the object name. Owner, Organization, and Project Clauses In addition to the primary owner, you can define up to two additional
owners for a business object or connection:
Unlike the primary owner for whom special privileges can be set in a policy (using “owner”), no privileges are set for the additional owners, except by virtue of their user name (that is, policies do not support the notion of generic ORGANIZATION or PROJECT access on every object governed by the policy). If you do not specify credentials, the following credentials are set for you:
You can also use
State ClauseThe lifecycle of a business object is assigned as part of the policy and consists of a series of object states. A state identifies a stage in the lifecycle of an object. Depending on the type of object involved, the lifecycle might contain only one state or many states. The states control the actual object instances and specify what can be done with an object after it is created. Each state defines who will have access to the object in that state, what type of access is allowed, whether or not the object can be revised, whether or not files within the object can be revised, and the conditions required for changing state. This clause is optional and can be used to specify the scheduled target date for this object in a particular state . It is not necessary to assign a date for any particular state. There might be situations where the change from one state to another might occur at any time. For example, if automobile insurance is contained within an object, the object might change when an accident occurs. Since accidents are not usually planned, no schedule date can be assigned. If, however, you have a state for policy renewal, the date can be scheduled since you know when the policy renewal is due. This is a target date only. The object will not automatically enter that state on the given date. The object can only be promoted after all required conditions are met—this date will not influence those conditions. The date is intended for informational purposes only. Actual dates are saved for each state in an object’s its lifecycle — and are the dates the object is promoted to that state. These dates are generally system-generated, but can be adjusted with this command for data migration purposes, for cases where the data being imported is from an external source that supports the concept of states with associated actual dates. Since the command is intended for use within a program object, it is up to the program to handle any errors. An error will result if the context user is not a business administrator with Schedule access to the object, or if the date is not specified in the required formats. When specifying the name of the state to which you want to assign a date, you must make sure it is a valid name. If the state name given in the State clause is not found in the policy you are assigning to the object, an error message will result. If that occurs, use the Print Policy command to check for the existence and spelling of the state name. When specifying the date within a State clause, you must use the date/time formats defined in your initialization file. If nothing is set there, the defaults are used. See Collaboration and Approvals Administration Guide: About Date Formats. For example, the following object definition will schedule the object to be in the “Re-evaluation and Renewal” state on June 30, 2002.
In this example, you want to remind the agent of when the homeowner’s insurance policy should be renewed. By inserting this date, an agent might promote the object to the “Re-evaluation and Renewal” state even if the date is June 26 (since it is close enough to the target date of June 30th.) Originated ClauseWhen migrating legacy data, you likely want to maintain the originated date from the legacy system. This clause allows you to assign an originated date. Without this clause, the originated date for objects is the date read from the system. For example:
You must specify the date using the date/time formats specified in your initialization file. If nothing is set there, the defaults are used. See the Collaboration and Approvals Administration Guide: About Date Formats. The actual creation date and time are logged in the create history record of the object. It is also returned with the originated selectable. The originated date can only be changed with the Modify Businessobject Originated command. Modified ClauseWhen migrating legacy data, you likely want to maintain the modified date from the legacy system. This clause allows you to assign a modification date. Without this clause, the modified date is the same as the creation date. For example:
You must specify the date using the date/time formats specified in your initialization file. If nothing is set there, the defaults are used. See the Collaboration and Approvals Administration Guide: About Date Formats. The modification date specified is returned with the modified selectable. Unlike the date specified with the originated clause, the modified date will change as normal if modifications are made after object creation. Current ClauseWhen migrating legacy data, you are likely to want to create business objects that are already beyond the first state of their policies. For example, you might want to add Parts that are already released. The Current clause of the Add Businessobject command allows you to create an object in any state of its governing policy. Without this clause, users create business objects in the first state of their governing policies. Since the Current clause identifies the state of the policy for the business object, it must be specified after the Policy clause. For example:
If the state “Approved” is not specified in the policy “Documentation”, an error message results. Promote triggers associated with the state specified do not fire since the object is created in and not promoted to the current state. The create trigger fires as usual. Attribute ClauseThis clause allows you to assign a specific value to one of the object’s attributes. As stated earlier, you must assign a type to any object being created. An object’s type might or might not have attributes associated with it. If it does, you can assign a specific value to the attribute using the Attribute clause. If you are unsure of either of the
For example, assume you are defining an object of type “Shipping Form” using the following Add Businessobject command:
Only the attributes associated with an object’s type can be assigned values for the instance. If you were to examine the definition for the type “Shipping Form,” you might find it has three attributes associated with it called “Label Type,” “Date Shipped,” and “Destination Type.” When this type is assigned to the object called “Lyon’s Order,” these attributes are automatically associated with the object. It is up to you as the user to assign values to the attributes. If you do not assign values, they remain blank or the default is used if there is one. To assign values, you can insert an Attribute clause into the object definition. When you are specifying an attribute value, be sure the value is in agreement with the attribute definition. In other words, only integer values are assigned to integer attributes, character string values are assigned to character string attributes, and so on. Also, if the attribute has a range of valid values, the value you give must be within that range. You can use the Print Attribute command to examine an attribute’s definition. For example, assume you are unsure of the definition of “Label Type.” If you examine the attribute definition, you might see that it is a character string value with no predefined range. With this knowledge, you can insert an Attribute clause to define a value similar to the following:
String attributes (as well as description fields) have a limit of 4,194,304 (4*1024*1024). If you expect to handle more data in an attribute, consider re-designing the schema to store the data in a checked-in file instead or use a binary attribute. If you want to assign values to each of the three attributes, you can write the object definition as:
With this definition, each attribute associated with the type “Shipping Form” will have a specific value and those values can be viewed whenever the “Lyon’s Order” object is accessed. Physical ID and Logical ID ClausesPhysical and logical IDs are required for Product Structure Design app. A physical ID is a global identifier that is unique to each business object or relationship. A logical ID is a global identifier shared by all members of a minor revision family. These clauses are available only if your database has been upgraded to use physical and logical IDs. For details on upgrading to use these IDs, see the Installation Guide: Upgrade Command. |