Content Management and Capture

Expand all | Collapse all

FileNet - How to set the PropertyDefinition required classid in java

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

    Posted 12 days ago
    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 11 days ago
    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 10 days ago
    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 10 days ago
    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 10 days ago
    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 10 days ago
    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 10 days ago
    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 9 days ago
    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 9 days ago
    Edited by Michael Seaman 9 days ago
    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
    ------------------------------