Skip to main content
Inspiring
Sep 12, 2022 12:15 PM UTC
Solved

how to use java methods in appian

I have to display the disk space used by the documents in an application in interface. 

I found this java method public java.lang.Long getMegaBytesUsed() in docs.appian.com

Can anyone tell me how to use this java method in Appian to get disk space. 

    stefanhelzle0001
    Brainy
    Sep 12, 2022 1:01 PM UTC

    Why is that necessary?

    You have options here. First, just iterate on all the document and sum it up.

    sum(
      a!foreach(
        items: folder(, "documentChildren"),
        expression: document(fv!item, "size")
      )
    )

    Or, store some meta data to the database and do that aggregation over there.

    But even more important, check out the excellent documentation

    https://docs.appian.com/suite/help/22.3/Appian_Functions.html

    https://docs.appian.com/suite/help/22.3/Expressions.html

    docs.appian.com/.../SAIL_Recipes.html

    4 replies

    stefanhelzle0001
    Brainy
    Sep 12, 2022 12:25 PM UTC

    You cannot use any Java in normal Appian. You can write plugins in Java.

    Why do you need Java to display the size of a document? Just call document(<YOUR_DOCUMENT>, "size").

    Inspiring
    Sep 12, 2022 12:28 PM UTC

    As part of the application I'm working on, I want to display the how much disk space is used by all the documents present in the KC of the application.

    If it is one application I can use call document(<YOUR_DOCUMENT>, "size").

    stefanhelzle0001
    Brainy
    Sep 12, 2022 1:01 PM UTC

    Why is that necessary?

    You have options here. First, just iterate on all the document and sum it up.

    sum(
      a!foreach(
        items: folder(, "documentChildren"),
        expression: document(fv!item, "size")
      )
    )

    Or, store some meta data to the database and do that aggregation over there.

    But even more important, check out the excellent documentation

    https://docs.appian.com/suite/help/22.3/Appian_Functions.html

    https://docs.appian.com/suite/help/22.3/Expressions.html

    docs.appian.com/.../SAIL_Recipes.html