IBM Support

IV97221: IMPLICIT VARIABLE 'SCRIPTNAME' IN AUTOMATION SCRIPT CAUSES ERROR

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • PROBLEM:
    Implicit variable 'scriptName' in 7.6 automation script
    log.info()
    calls giving error "NameError: name 'scriptName' is not defined
    in
    <script> at line number"
    When using the Implicit variable 'scriptName' in 7.6 automation
    script
    log.info() calls it produces the following error: "NameError:
    name
    'scriptName' is not defined in <script> at line number
    
    PERFORMANCE ISSUE:no
    
    STEPS TO REPRODUCE:
    1) Create a Custom Condition LaunchPoint
    
    Go go > System Configuration > Platform Configuration >
    Automation
    Scripts
    
    Select Action > Create > Script with Custom Condition
    LaunchPoint.
    
    LaunchPoint = EX1WOCNDPARENT
    Object = WORKORDER
    
    Next
    
    Script = EX1WOPARENTCROSSOVR
    Language = Python
    Log Level =  INFO
    
    Next
    
    Source Code:
    
    from psdi.util.logging import MXLoggerFactory
    
    log = MXLoggerFactory.getLogger("maximo.script")
    
    log.info('**** Starting to execute script: ' + scriptName)
    
    # log.info('**** Starting to execute script:
    EX1WOPARENTCROSSOVR')
    
    log.info('**** Starting to execute launch point: ' +
    launchPoint)
    
    
    
    workOrderNum = mbo.getString('WONUM')
    
    log.info('workOrderNum: ' + workOrderNum + ', onadd: ' +
    str(onadd))
    
    evalresult = onadd
    
    
    Click Create
    
    
    2) Create a new Condition
    
    Go to > Administration > Conditional Expression Manager
    
    Click New Row
    
    Condition = EX1WOPARENT
    Type = CLASS
    Expression = EX1WOPARENTCROSSOVR:EX1WOCNDPARENT
    Class = com.ibm.tivoli.maximo.script.ScriptCustomCondition
    Always Evaluate = True
    
    Save
    
    3) Create a new CrossOver Domain
    
    Go to > System Configuration > Platform Configuration > Domains
    
    Click Add New Domain > Add New CrossOver Domain
    
    Domain = EX1WOTOWOCHILD
    
    Object = WORKORDER
    Validation Where Clause = WONUM=:parent AND
    WOCLASS=:NEWCHILDCLASS
    List Where Clause = wonum != :wonum and wonum not in (select
    wonum from
    workorder where parent = :wonum) and siteid = :siteid and
    status not in
    ('COMP','FCOMP','CLOSE','CAN') and woclass = :woclass
    
    Under CrossOver Fields, Click New Row
    
    Source Field = ASSETNUM
    Destination Field = ASSETNUM
    Accept Null Value = True
    
    Condition on Destination = EX1WOPARENT
    
    Save
    
    4) Associate the Domain with WORKORDER.PARENT
    
    Go to > System Configuration > Platform Configuration > Database
    Configuration
    
    Pick up WORKORDER in the list tab and switch to Attributes tab
    Find PARENT and expand the details section
    Set Domain = EX1WOTOWOCHILD
    
    Save
    
    Go back to the List Tab > Select Action > Apply Configuration
    Changes >
    Start Configuring Database
    
    Enter Maxadmin credentials > OK
    
    As this is a Non Structural Change, there is no need to Turn
    Admin Mode
    on.
    
    5) Reproduce the problem
    
    Go to > Work Orders > Work Order Tracking
    
    Click New and fill in WONUM if not auto generated
    Click Save
    Select Action > Assign to new Parent
    In the popup dialog, select any WONUM.
    
    CURRENT ERRONEOUS RESULT:
    Error occurs when scriptname variable used in script to log
    script details
    
    EXPECTED RESULT:
    No error when scriptname variable used in script to log script
    details
    
    ADDITIONAL INFO:
    script context is not getting updated with the script name.
    
    ENVIRONMENT (SYSTEM INFO):
    TPAE 7.605 - IFIX 20160914
    

Local fix

  • na
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All Maximo Users                                             *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * When executing an autoscript using implicit variable         *
    * "scriptName", an error is generated which states "NameError: *
    * name 'scriptName' is not defined in <script> at line number  *
    * 3".                                                          *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    

Problem conclusion

  • The fix for this APAR is included in the following package:
                          | Release 7.6.0.9 of Base Services.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV97221

  • Reported component name

    SYSTEM CONFIG

  • Reported component ID

    5724R46S1

  • Reported release

    760

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-06-14

  • Closed date

    2017-06-16

  • Last modified date

    2017-06-16

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    SYSTEM CONFIG

  • Fixed component ID

    5724R46S1

Applicable component levels

  • R760 PSY

       UP



Document information

More support for: Maximo Asset Management

Software version: 760

Reference #: IV97221

Modified date: 16 June 2017