Overview Schemas Index

Thermal_network_definition_arm (jsdai.SThermal_network_definition_arm)


FUNCTION using_representations
          (item : Representation_item) : SET [0:?] OF Representation;

LOCAL
      results            : SET  OF  Representation;
      result_bag         : BAG OF  Representation;
      intermediate_items : SET  OF  Representation_item;
    END_LOCAL;
    -- Find the representations IN  which the item is used AND  add TO  the
    -- results set.
    results := [];
    result_bag := USEDIN(item,'FOUNDATION_REPRESENTATION_ARM.REPRESENTATION.ITEMS');
    IF  SIZEOF(result_bag) > 0 THEN
      REPEAT  i := 1 TO  HIINDEX(result_bag);
        results := results + result_bag[i];
      END_REPEAT;
    END_IF;
    -- Find all representation_items OR  founded_items
    -- BY which item is referenced directly OR  indirectly.
    intermediate_items := using_items(item,[]);
    -- IF  the SET  OF  intermediate items is NOT empty;
    IF  SIZEOF(intermediate_items) > 0 THEN
      -- FOR each element IN  the set, add the
      -- representations OF  that element.
      REPEAT  i := 1 TO  HIINDEX(intermediate_items);
        result_bag := USEDIN(intermediate_items[i],
                      'FOUNDATION_REPRESENTATION_ARM.REPRESENTATION.ITEMS');
        IF SIZEOF(result_bag) > 0 THEN
          REPEAT j := 1 TO HIINDEX(result_bag);
            results := results + result_bag[j];
          END_REPEAT;
        END_IF;
      END_REPEAT;
    END_IF;
    -- RETURN  the SET OF representation IN which the input item is
    -- used directly AND indirectly (through intervening
    -- representation_items OR founded items).
    RETURN (results);

END_FUNCTION; -- using_representations

public class FUsing_representations
          public static Value run(SdaiContext _context, Value item)