Decision Management & Intelligence (ODM, DI)

Decision Management & Intelligence (ODM, DI)

Connect with experts and peers to elevate technical expertise, solve problems and share insights

 View Only
Expand all | Collapse all

How to change the rule status flag to new when the newly created rule is copied from another project?

  • 1.  How to change the rule status flag to new when the newly created rule is copied from another project?

    Posted Thu September 24, 2020 03:19 PM

    By default, once when a rule is copied from one project to another, the status flag status field remains from the original status field. How can I over-write this behavior?



    #OperationalDecisionManager(ODM)
    #Support
    #SupportMigration


  • 2.  RE: How to change the rule status flag to new when the newly created rule is copied from another project?
    Best Answer

    Posted Thu September 24, 2020 03:27 PM

    If you want to over-write this behavior, you can modify the ODM change notification sample here which it can be found at https://www.ibm.com/support/knowledgecenter/SSQP76_8.9.2/com.ibm.odm.dcenter.samples/topics/smp_tsbrm_changenotif.html

    Here is the sample snippet:

    public void onCommitElement(IlrBranch branch, IlrCommitableObject cobject) throws IlrApplicationException {

    IlrSession session = this.session;

    IlrElementDetails details = cobject.getRootDetails();

    if (details != null && session.getBrmPackage().getBusinessRule().isSuperTypeOf(details.eClass()) && details.isNew()) {

    session = details.getSession();

    EStructuralFeature status = (EStructuralFeature) session

    .getModelInfo()

    .getElementFromFQN("brm.BusinessRule.status");

    details.setRawValue(status, "new");

    }

    super.onCommitElement(branch, cobject);

    }



    #OperationalDecisionManager(ODM)
    #Support
    #SupportMigration