Content Management and Capture

 View Only
  • 1.  FileNet - How to set the PropertyDefinition required classid in java

    Posted Tue April 06, 2021 02:32 AM
    Hello,

    we want to define an object as property in a folder class (like business objects in Case Manager).

    How to proceed to create such property ? The error message "FNRCE0058E: E_REQUIRED_VALUE_ABSENT" for the property "RequiredClassId" is returned at folder class save step.

    Thanks for help
    Yannick

    ------------------------------
    Yannick Martin
    ------------------------------


  • 2.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Wed April 07, 2021 05:09 AM
    If you're creating a PropertyDefinitionObject (from a PropertyTemplateObject), then prior to saving the Class Definition to which you're adding that property definition, simply set_RequiredClassId() to the id of the class of object to which the object-valued property should refer.

    ------------------------------
    Mike
    ------------------------------



  • 3.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Thu April 08, 2021 02:54 AM
    Hello Mike,

    I create manually a property template with data type Object: PTO
    As you suggested I create a PropertyDefinitionObject based on this PTO and I defines the RequiredClassId with an abstract dependent subclass (named MyBO).

    The error message return at class defintion save is:
    com.filenet.api.exception.EngineRuntimeException: FNRCE0015E: E_CONSTRAINT_VIOLATED: The operation violates a constraint of the implementation. The dependent class MyBO may not be specified as the required class for a singleton or enumeration property. failedBatchItem=0

    The code is:
    ClassDefinition classDef = Factory.ClassDefinition.fetchInstance(connector.getObjectStore(), "MyFolderSubClass", null);
    String rcIdString = connector.getId("MyBO", PropertyNames.SYMBOLIC_NAME, ClassNames.CLASS_DEFINITION);
    String idString = connector.getId("PTO", PropertyNames.SYMBOLIC_NAME, PropertyNames.PROPERTY_TEMPLATE);

    PropertyTemplateObject pto = Factory.PropertyTemplateObject.fetchInstance(connector.getObjectStore(), new Id(idString), null);
    PropertyDefinitionObject pd = (PropertyDefinitionObject) pto.createClassProperty();
    pd.set_RequiredClassId(new Id(rcIdString));
    classDef.get_PropertyDefinitions().add(pd);
    classDef.save(RefreshMode.REFRESH);

    Thansk for help

    ------------------------------
    Yannick Martin
    ------------------------------



  • 4.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Thu April 08, 2021 04:40 AM
    Dependent objects can only be inserted into a property with cardinality LIST (i.e. one which the API represents on instances as a PropertyDependentObjectList). That's what the exception is telling you, that you cannot make the dependent MyBO class required for a property of cardinality SINGLE or ENUM.

    ------------------------------
    Mike
    ------------------------------



  • 5.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Thu April 08, 2021 09:24 AM
    Hello,

    Our first goal was to create a property with cardinality set to LIST but in ACCE we create a PropertyTemplate with data type "Object" and cardinality "List":

    But the cardinality is not displayed when we open the created property template:

    And when we use this property the constraint implementation asks to define the reflectivity Id.

    Regards

    ------------------------------
    Yannick Martin
    ------------------------------



  • 6.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Thu April 08, 2021 09:40 AM
    In fact the property template is an ENUM, but during the property creation, the ENUM cardinality (list of primary colors) is disabled.

    ------------------------------
    Yannick Martin
    ------------------------------



  • 7.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Thu April 08, 2021 09:45 AM
    Yes, unfortunately at this point ACCE does not have support for creating dependent list properties, either templates or definitions. You have to do the whole thing programmatically (template as well).

    ------------------------------
    Mike
    ------------------------------



  • 8.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Fri April 09, 2021 03:26 AM
    Hello MIchael, 

    I go one step further but by the folder class definition save,  a Null exception occurs in method "getDependentTableAndColumnFromClassDef".
    The created property template object has LIST cardinality and persistence type OWN TABLE.

    I cannot find help in IBM Docs.

    Do you have an idea ?

    Thanks


    ------------------------------
    Yannick Martin
    ------------------------------



  • 9.  RE: FileNet - How to set the PropertyDefinition required classid in java

    Posted Fri April 09, 2021 05:03 AM
    Edited by Michael Seaman Fri April 09, 2021 06:14 AM
    I suggest at this point you open a support case and supply your code and full details of the exception you're getting. This has gone beyond the level of detail for which this forum is suited.

    However, the problem here may be simply that you haven't specified the correct required class id (of your MyBO class).

    ------------------------------
    Mike
    ------------------------------