Adding Assign Identity in Rulebase
Procedure
-
Define a rule and save it in the
catalogvalidation.xml file for the repository. Refer to the following sample:
<?xml version="1.0" encoding="UTF-8"?> <rulebase metaversion="1.0"> <name>Catalog Validations</name> <description>Catalog Validations</description> <constraint> <name>identitycheck</name> <description>find identity and assign</description> <action> <assignidentity> <explanation>Identity is assigned.</explanation> <var>AssignSequence1</var> <var>FIRSTNAME</var> <var>LASTNAME</var> </assignidentity> </action> </constraint> </rulebase>
-
Create a new record and specify the values for FIRSTNAME and LASTNAME business key variables. For information on creating records, refer to
Creating Records.
- If you specify values that do not match existing records, the <assignidentity> action retrieves PRODUCTID using the specified sequence and assign it to a record. However, PRODUCTIDEXT remains null.
- If you specify values that match an existing record, the <assignidentity> action retrieves PRODUCTID and PRODUCTIDEXT and assigns them to a record.
- However, if <assignidentity> action locates multiple matching records, it does not assign PRODUCTID and PRODUCTIDEXT to a record.
-
Create a rulebase file. For example,
assignidentiy.xml and use it in the Rulebase parameter of the PrepareForImportCatalog activity.
Import data without PRODUCTID and PRODUCTIDEXT and verify the result.
Copyright © Cloud Software Group, Inc. All rights reserved.