Overview Schemas Index

Thermal_network_definition_arm (jsdai.SThermal_network_definition_arm)


FUNCTION using_items
          (item : Representation_item; checked_items : SET [0:?] OF Representation_item) : SET [0:?] OF Representation_item;

LOCAL
      new_check_items    : SET  OF  Representation_item;
      result_items       : SET  OF  Representation_item;
      next_items         : SET  OF  Representation_item;
    END_LOCAL;
    result_items := [];
    new_check_items := checked_items + item;
    -- Find the SET  OF  representation_items OR  founded_items
    -- IN  which item is used directly.
    next_items := QUERY(z <* bag_to_set( USEDIN(item , '')) |
      ('FOUNDATION_REPRESENTATION_ARM.REPRESENTATION_ITEM' IN  TYPEOF(z)));
    -- IF  the SET  OF  next_items is NOT empty;
    IF  SIZEOF(next_items) > 0 THEN
      -- FOR  each element IN  the set, find the using_items recursively
      REPEAT i := 1 TO HIINDEX(next_items);
        -- Check FOR loop IN  data model, i.e. one OF  the next_items
        -- occurred earlier IN  the SET  OF  check_items;
        IF NOT(next_items[i] IN  new_check_items) THEN
          result_items := result_items + next_items[i] +
                          using_items(next_items[i],new_check_items);
        END_IF;
      END_REPEAT;
    END_IF;
    -- RETURN  the SET OF representation_items OR founded_items
    -- IN which the input item is used directly AND indirectly.
    RETURN (result_items);

END_FUNCTION; -- using_items

public class FUsing_items
          public static Value run(SdaiContext _context, Value item, Value checked_items)