Previous Topic

Book Contents

Book Index

Next Topic

pyeval
  • Functionality

    Evaluates a Python expression passed in the first argument.

    The expression can use the following variables:

    • bo

      Business Object of calculation.

    • VM

      Valuemation API Application.

    • vm

      Root of Python packages implemented in workflow libraries.

    • java

      Root of standard Java packages.

    • python

      Root of standard Python packages.

Note: The expression also works with any Valuemation API object, java object or Python object.

  • Arguments

    pyeval(String pythonexpression)

  • Return

    Object whose type depends on the type of the result attribute. It can be String, Number, Boolean or Date.

  • Examples

    pyeval('python.modules.math.pi*bo.radius**2')

    eq(pyeval('(
    bool(bo.reqitems(reqitemStatus__ne = 'AP', itemtype__itemtype = 'M%'))
    )'),1)

    pyeval('(
    localize('reqitem_reserveManually_option2Description', (bo.datRequisition, bo.requisition))
    )')

    pyeval('(
    java.sql.Date(
    bo.datRequisition.time
    + bo.delayindays
    * (24L*3600L*1000L)
    )
    )')

See Also

Available Functions

cast

countService

countService2

currencyConversion

cmp

dayOfMonth

ge (greater or equals than), ge_

gt (greater than), gt_

le (less or equals than), le_

lt (less than), lt_

eq (equals), eq_ and cmp

ne_

evalCondition

evalExpression

not

isNull

Null

getAttributeTranslation

getAuditedBOTranslation

getAuditedValueRelation

getBOTypeTranslation

getCurrentDate

getCurrentTime

getCurrentTimeStamp

getCurrentUserld

getMaximalTimeStamp

getMaximalDate

getParameter

getPicture()

getValuesetTranslation

if, case and coalesce

trimLeft

isValid

max

min

month

round

size

substring

sum

trim

trimRight

replaceFromEnd

unit conversion

translate

valueset

year