Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-5841

Public API: Allow extra-metadata in DataContext

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • None
    • None
    • Core Engine
    • None
    • False
    • False
    • 2021 Week 40-42 (from Oct 4), 2021 Week 43-45 (from Oct 25)

    Description

      Current design mandates that the DataContext only contains "data".

      However, there are many use cases where the "request" that we "send" to the engine, requires extra parameters that are not part of the payload, but directives to the engine itself, i.e. metadata.

      Define a way to provide such metadata.

      e.g. *one possibility* may be to define an extended DataContext :

      interface ExtendedDataContext extends DataContext {
          MetaDataContext meta();
          DataContext data();
      }
      // then:
      MetaDataContext meta = MapDataContext.create();
      ctx.set("some-flag", value);
      MyCustomCtx datactx = new MyCustomCtx(...,...,...); 
      DataContext ctx = ExtendedDataContext.create(meta, datactx);
      // the service decodes the type of context
      DataContext res = dmnSvc.evaluate(someId, ctx); 
      ExtendedDataContext ext = res.as(ExtendedDataContext.class);
      MetaDataContext = ext.meta() // may be empty
      MyCustomCtx tres = ext.data().as(MyCustomCtx.class) // extract a typed result 
      

      Explore this design space.

      Attachments

        Issue Links

          Activity

            People

              evacchi Edoardo Vacchi (Inactive)
              evacchi Edoardo Vacchi (Inactive)
              Marian Macik Marian Macik
              Marian Macik Marian Macik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: