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

SWF - Expose Stunner API through omnichannel architecture

XMLWordPrintable

    • 2022 Week 17-19 (from Apr 25), 2023 Week 12-14 (from Mar 20), 2023 Week 15-17 (from Apr 10), 2023 Week 18-20 (from May 1), 2023 Week 21-23 (from May 22)

      Goal

      Expose the Stunner's editor API [1]  at the tooling's Envelope scope, so making it available for communication across different application shells (relying the the envelope bus)

      Details

      Consider the following schema for the different layers for the SWF Diagram Editor:

       

      Actions:

      • Expose the J2CL Stunner Editor API into typescript => TS Stunner Editor API 
      • Create the SWF Diagram Editor Envelope API and implementations
      • Create an SWF Diagram Editor API in the Combined Editor layer, for the use of third parties

       

       [1] See Stunner editor's J2CL API at KOGITO-7999

       [*] See SWF Diagram Editor presentation here.

      Supported functions

      Only the subset of functions implemented in KOGITO-7999 will be exposed. The supported functions follows:

      // Session API
      editor.session.getAllNodesUUID() : Promise<string[]>;
      editor.session.getEdgeByUUID(uuid: string) : Promise<Edge>;
      editor.session.getNodeByUUID(uuid: string) : Promise<Node>;
      editor.session.getDefinitionByElementUUID(uuid: string) : Promise<Object>;
      editor.session.getNodeByName(name: string) : Promise<Node>;
      editor.session.getNodeName(node: Node) : Promise<string>;
      editor.session.getSelectedElementUUID() : Promise<string>;
      editor.session.getSelectedNode() : Promise<Node>;
      editor.session.getSelectedEdge() : Promise<Edge>;
      editor.session.getSelectedDefinition() : Promise<Object>;
      editor.session.selectByUUID(uuid: string) : Promise<void>;
      editor.session.selectByName(name: string) : Promise<void>;
      editor.session.clearSelection() : Promise<void>;
      
      // Canvas API
      editor.canvas.getShapeIds() : Promise<string[]>;
      editor.canvas.getBackgroundColor(uuid: string) : Promise<string>;
      editor.canvas.setBackgroundColor(uuid: string, backgroundColor: string):  Promise<void>;
      editor.canvas.getBorderColor(uuid: string) : Promise<string>;
      editor.canvas.setBorderColor(uuid: string, backgroundColor: string) : Promise<void>;
      editor.canvas.getLocation(uuid: string) : Promise<number[]>;
      editor.canvas.getAbsoluteLocation(uuid: string) : Promise<number[]>;
      editor.canvas.getDimensions(uuid: string) : Promise<number[]>;
      editor.canvas.center(uuid: string): Promise<void>;
      editor.canvas.draw() : Promise<void>;
      

      Acceptance criteria

      The API is exposed to SWF Combined Editor.
      See supported functions above.

            romartin@redhat.com Roger Martinez
            romartin@redhat.com Roger Martinez
            Lubomir Terifaj Lubomir Terifaj
            Lubomir Terifaj Lubomir Terifaj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: