Topic
  • 4 replies
  • Latest Post - ‏2012-05-17T07:58:23Z by johnjingle
johnjingle
johnjingle
12 Posts

Pinned topic Is it possible to create a MarkingSet programatically.

‏2012-05-16T09:27:34Z |
Is it possible to create a MarkingSet programatically please. Adding Markings to an existing
Marking Set is ok but I cannot see how to add a MarkingSet to a MarkingSetSet.
  • SystemAdmin
    SystemAdmin
    693 Posts

    Re: Is it possible to create a MarkingSet programatically.

    ‏2012-05-16T11:37:14Z  
    Yes, you can. In fact, all applications, including FEM and ACCE, use exposed APIs for CE interactions. (The only exceptions are a few upgrade and repair applications.)

    You do not directly add elements to any CE API Set collection. Those are read-only enumerations. If you use Factory.MarkingSet.createInstance() to create a new MarkingSet, it will automatically show up in Domain.get_MarkingSets().
  • johnjingle
    johnjingle
    12 Posts

    Re: Is it possible to create a MarkingSet programatically.

    ‏2012-05-16T14:31:19Z  
    Thanks yet again but I tried below to no avail.

    com.filnet.api.security.MarkingSet ms = Factory.MarkingSet.createInstance(domain);
    ms.set_DisplayName("john");

    MarkingSetSet mss = domain.get_MarkingSets();
    Iterator it = mss.iterator();

    while ....
    and the new Marking Set is not be be seen.
  • SystemAdmin
    SystemAdmin
    693 Posts

    Re: Is it possible to create a MarkingSet programatically.

    ‏2012-05-17T05:28:46Z  
    Thanks yet again but I tried below to no avail.

    com.filnet.api.security.MarkingSet ms = Factory.MarkingSet.createInstance(domain);
    ms.set_DisplayName("john");

    MarkingSetSet mss = domain.get_MarkingSets();
    Iterator it = mss.iterator();

    while ....
    and the new Marking Set is not be be seen.
    You must call ms.save() to persist the newly created MS before you call domain.get_MarkingSets(). (Calling save() is a general rule for persisting updates in when using the CE APIs.)
  • johnjingle
    johnjingle
    12 Posts

    Re: Is it possible to create a MarkingSet programatically.

    ‏2012-05-17T07:58:23Z  
    Thanks again.