SlideShare a Scribd company logo
1 of 21
(ATS3-DEV01) Introduction to
 Scripting in Symyx Notebook
                                  Mark Benzel
             Principal Software Engineer, R&D
                   mark.benzel@accelrys.com
The information on the roadmap and future software development efforts are
intended to outline general product direction and should not be relied on in making
a purchasing decision.
Scripting in Notebook
In-place Python editors are available in several places
  • Experiment Editor toolbars
  • Experiment Editor events
  • Form events and buttons
  • Table section events
  • Property events
Dynamic Toolbars

• Toolbar buttons backed by Python script can be added to the
  Experiment Editor

• Attached to Document Templates
   – Every experiment created from that template has the buttons
Demo
 • Dynamic toolbars
Dynamic Toolbars
• Can be attached at the document level or section level

• Script environment is populated with useful variables from Notebook
    – Key variables: editor, active_workspace


• Static Notebook classes are available to the script environment, and
  objects from the Notebook API may be instantiated
Experiment Editor Events
• Experiment Editor Events

    – Scripts can be executed when a number of events in the Experiment Editor happen

    – As with dynamic toolbars, they are associated with document templates, and can be
      attached at the document level or the document section level

    – Some events can be canceled via script
Demo
 • Experiment Editor events
Experiment Editor Events
•   List of Experiment Editor Events:
      OnApplicationClosing
      OnApplicationLoaded
      OnSaving
      OnSaved
      OnInsertingSection
      OnLockingSection
      OnRemovingSection
      OnSectionInserted
      OnSectionLocked
      OnSectionRemoved
      OnSectionUnlocked
      OnUnlockingSection
      OnMenuItemEnabledStatesUpdated
      OnToolBarButtonEnabledStatesUpdated
      OnSectionActivated
      OnSectionDeactivated

•   Key variables:
      –     e
                •    e.Section (for section-specific events)
                •    e.Cancel, e.CancelReason (for cancelable events)

      –     editor
                •    Represents the Experiment Editor
                •    Properties and methods are defined in IDocumentEditor

      –     active_workspace
                •    Provides services for contacting Vault
Forms Events

• Scripts can be attached to form and widget events
   – Form events:
      • OnEdit
      • OnValueChanged

   – Widget events:
      • OnReview
      • OnValidate
      • OnClick (buttons only)
Demo
 • Forms events
Forms Events

• OnEdit doesn’t fire when the form is in read-only mode
    – If OnApplicationLoaded is needed, you can put a form in a section template and have
      users insert the template instead of the form



• Review Results can’t prevent a document from getting checked in
    – However the workflow Review activity can prevent a document from transitioning to
      the next stage based on review results
Table Section Scripting
•   Can write scripts for the following events:

      –    After Cell Value Changed
      –    After Import Row
      –    After Record Weights
      –    Before Import Row
      –    Before Record Weights
      –    Removing Row
      –    Request Column Dictionary
      –    Row Added
      –    Row Changed
      –    Row Removed
      –    Signing Options


•   Additional events for Materials sections
      –    After Import Materials
      –    Before Import Materials


•   Additional hierarchical table events (Preparations, Formulations)

      –    Audit script
      –    Component Added
      –    Component Removed
      –    Component Request Column Dictionary
      –    Component Row Changed
      –    Removing Component
      –    Replicate Created
Demo
 • Table section scripting
Table Section Scripting
• Key script variables

    – sender : the TableSection

    – e
          •   FieldName
          •   OldValue
          •   TheDataRow
          •   Value

          • Cancel, CancelMessage (if cancelable)

    – row (for row-based events)
Property Events

• Property Set Definitions are reusable field
  definitions used by table and form sections.

• Can attach scripts to events at the property level:
   –   Set Initial Value
   –   Calculated Value
   –   Property Changed
   –   Validations
Demo
 • Property events scripting
Property Events
•   Key variables
     –   host_object
           •   property set host
           •   E.g. Material
     –   properties
     –   property
     –   value: output parameter for Initial Value and Calculated Value scripts

     – e
           •   ValueChangedEventArgs
           •   e.OldValueIsNull
           •   e.NewValueIsNull
           •   e.NewValue
           •   e.OldValue
           • e.Key: QualifiedPropertyKey
           • ValidationResult[] ValidationResults
Tips and tricks
•   Scripting Performance

     –   Beware of events that happen when the Experiment Editor loads, or when changing section.
           •   OnApplicationLoaded
           •   OnSectionActivated
           •   OnSectionDeactivated
           •   FormEdit

     –   Avoid the wire

     –   Use “Minimal Get’s” whenever possible

     –   Employ short-circuit coding

•   Use the new script performance logging feature provided in Symyx Notebook 6.6 SP1
Summary

• Covered the various places scripting can be used in Symyx
  Notebook
   –   Experiment Editor toolbars
   –   Experiment Editor events
   –   Form events and buttons
   –   Table section events
   –   Property events
• Resources
   – Symyx Notebook Developer’s Guide
        • Section entitled “Scripting in Symyx Notebook”
   – IronPython in Action
The information on the roadmap and future software development efforts are
intended to outline general product direction and should not be relied on in making
a purchasing decision.


For more information on the Accelrys Tech Summits and other IT & Developer information,
please visit:
https://community.accelrys.com/groups/it-dev

More Related Content

More from BIOVIA

(ATS6-PLAT05) Security enhancements in AEP 9
(ATS6-PLAT05) Security enhancements in AEP 9(ATS6-PLAT05) Security enhancements in AEP 9
(ATS6-PLAT05) Security enhancements in AEP 9BIOVIA
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service BIOVIA
 
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol ValidationBIOVIA
 
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...BIOVIA
 
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...BIOVIA
 
(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOSBIOVIA
 
(ATS6-GS01) Welcome
(ATS6-GS01) Welcome (ATS6-GS01) Welcome
(ATS6-GS01) Welcome BIOVIA
 
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol AuthorsBIOVIA
 
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful APIBIOVIA
 
(ATS6-DEV07) Building widgets for ELN home page
(ATS6-DEV07) Building widgets for ELN home page(ATS6-DEV07) Building widgets for ELN home page
(ATS6-DEV07) Building widgets for ELN home pageBIOVIA
 
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
(ATS6-DEV06) Using Packages for Protocol, Component, and Application DeliveryBIOVIA
 
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
(ATS6-DEV05) Building Interactive Web Applications with the Reporting CollectionBIOVIA
 
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...BIOVIA
 
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEPBIOVIA
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application StrategiesBIOVIA
 
(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0
(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0
(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0BIOVIA
 
(ATS6-APP09) ELN configuration management with ADM
(ATS6-APP09) ELN configuration management with ADM(ATS6-APP09) ELN configuration management with ADM
(ATS6-APP09) ELN configuration management with ADMBIOVIA
 
(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...
(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...
(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...BIOVIA
 
(ATS6-APP05) Deploying Contur ELN to large organizations
(ATS6-APP05) Deploying Contur ELN to large organizations(ATS6-APP05) Deploying Contur ELN to large organizations
(ATS6-APP05) Deploying Contur ELN to large organizationsBIOVIA
 
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline PilotBIOVIA
 

More from BIOVIA (20)

(ATS6-PLAT05) Security enhancements in AEP 9
(ATS6-PLAT05) Security enhancements in AEP 9(ATS6-PLAT05) Security enhancements in AEP 9
(ATS6-PLAT05) Security enhancements in AEP 9
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
 
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
(ATS6-PLAT01) Chemistry Harmonization: Bringing together the Direct 9 and Pip...
 
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
(ATS6-GS04) Performance Analysis of Accelrys Enterprise Platform 9.0 on IBM’s...
 
(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS(ATS6-GS02) Integrating Contur and HEOS
(ATS6-GS02) Integrating Contur and HEOS
 
(ATS6-GS01) Welcome
(ATS6-GS01) Welcome (ATS6-GS01) Welcome
(ATS6-GS01) Welcome
 
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
(ATS6-DEV09) Deep Dive into REST and SOAP Integration for Protocol Authors
 
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
(ATS6-DEV08) Integrating Contur ELN with other systems using a RESTful API
 
(ATS6-DEV07) Building widgets for ELN home page
(ATS6-DEV07) Building widgets for ELN home page(ATS6-DEV07) Building widgets for ELN home page
(ATS6-DEV07) Building widgets for ELN home page
 
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
(ATS6-DEV06) Using Packages for Protocol, Component, and Application Delivery
 
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
(ATS6-DEV05) Building Interactive Web Applications with the Reporting Collection
 
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
 
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP(ATS6-DEV03) Building an Enterprise Web Solution with AEP
(ATS6-DEV03) Building an Enterprise Web Solution with AEP
 
(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies(ATS6-DEV02) Web Application Strategies
(ATS6-DEV02) Web Application Strategies
 
(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0
(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0
(ATS6-DEV01) What’s new for Protocol and Component Developers in AEP 9.0
 
(ATS6-APP09) ELN configuration management with ADM
(ATS6-APP09) ELN configuration management with ADM(ATS6-APP09) ELN configuration management with ADM
(ATS6-APP09) ELN configuration management with ADM
 
(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...
(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...
(ATS6-APP07) Configuration of Accelrys ELN to Clone to the Latest Template Ve...
 
(ATS6-APP05) Deploying Contur ELN to large organizations
(ATS6-APP05) Deploying Contur ELN to large organizations(ATS6-APP05) Deploying Contur ELN to large organizations
(ATS6-APP05) Deploying Contur ELN to large organizations
 
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot
(ATS6-APP03) Thomson Rueters Content used in Acclrys Pipeline Pilot
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

(ATS3-DEV01) Introduction to Scripting in Symyx Notebook

  • 1. (ATS3-DEV01) Introduction to Scripting in Symyx Notebook Mark Benzel Principal Software Engineer, R&D mark.benzel@accelrys.com
  • 2. The information on the roadmap and future software development efforts are intended to outline general product direction and should not be relied on in making a purchasing decision.
  • 3. Scripting in Notebook In-place Python editors are available in several places • Experiment Editor toolbars • Experiment Editor events • Form events and buttons • Table section events • Property events
  • 4. Dynamic Toolbars • Toolbar buttons backed by Python script can be added to the Experiment Editor • Attached to Document Templates – Every experiment created from that template has the buttons
  • 5. Demo • Dynamic toolbars
  • 6. Dynamic Toolbars • Can be attached at the document level or section level • Script environment is populated with useful variables from Notebook – Key variables: editor, active_workspace • Static Notebook classes are available to the script environment, and objects from the Notebook API may be instantiated
  • 7. Experiment Editor Events • Experiment Editor Events – Scripts can be executed when a number of events in the Experiment Editor happen – As with dynamic toolbars, they are associated with document templates, and can be attached at the document level or the document section level – Some events can be canceled via script
  • 8. Demo • Experiment Editor events
  • 9. Experiment Editor Events • List of Experiment Editor Events: OnApplicationClosing OnApplicationLoaded OnSaving OnSaved OnInsertingSection OnLockingSection OnRemovingSection OnSectionInserted OnSectionLocked OnSectionRemoved OnSectionUnlocked OnUnlockingSection OnMenuItemEnabledStatesUpdated OnToolBarButtonEnabledStatesUpdated OnSectionActivated OnSectionDeactivated • Key variables: – e • e.Section (for section-specific events) • e.Cancel, e.CancelReason (for cancelable events) – editor • Represents the Experiment Editor • Properties and methods are defined in IDocumentEditor – active_workspace • Provides services for contacting Vault
  • 10. Forms Events • Scripts can be attached to form and widget events – Form events: • OnEdit • OnValueChanged – Widget events: • OnReview • OnValidate • OnClick (buttons only)
  • 11. Demo • Forms events
  • 12. Forms Events • OnEdit doesn’t fire when the form is in read-only mode – If OnApplicationLoaded is needed, you can put a form in a section template and have users insert the template instead of the form • Review Results can’t prevent a document from getting checked in – However the workflow Review activity can prevent a document from transitioning to the next stage based on review results
  • 13. Table Section Scripting • Can write scripts for the following events: – After Cell Value Changed – After Import Row – After Record Weights – Before Import Row – Before Record Weights – Removing Row – Request Column Dictionary – Row Added – Row Changed – Row Removed – Signing Options • Additional events for Materials sections – After Import Materials – Before Import Materials • Additional hierarchical table events (Preparations, Formulations) – Audit script – Component Added – Component Removed – Component Request Column Dictionary – Component Row Changed – Removing Component – Replicate Created
  • 14. Demo • Table section scripting
  • 15. Table Section Scripting • Key script variables – sender : the TableSection – e • FieldName • OldValue • TheDataRow • Value • Cancel, CancelMessage (if cancelable) – row (for row-based events)
  • 16. Property Events • Property Set Definitions are reusable field definitions used by table and form sections. • Can attach scripts to events at the property level: – Set Initial Value – Calculated Value – Property Changed – Validations
  • 17. Demo • Property events scripting
  • 18. Property Events • Key variables – host_object • property set host • E.g. Material – properties – property – value: output parameter for Initial Value and Calculated Value scripts – e • ValueChangedEventArgs • e.OldValueIsNull • e.NewValueIsNull • e.NewValue • e.OldValue • e.Key: QualifiedPropertyKey • ValidationResult[] ValidationResults
  • 19. Tips and tricks • Scripting Performance – Beware of events that happen when the Experiment Editor loads, or when changing section. • OnApplicationLoaded • OnSectionActivated • OnSectionDeactivated • FormEdit – Avoid the wire – Use “Minimal Get’s” whenever possible – Employ short-circuit coding • Use the new script performance logging feature provided in Symyx Notebook 6.6 SP1
  • 20. Summary • Covered the various places scripting can be used in Symyx Notebook – Experiment Editor toolbars – Experiment Editor events – Form events and buttons – Table section events – Property events • Resources – Symyx Notebook Developer’s Guide • Section entitled “Scripting in Symyx Notebook” – IronPython in Action
  • 21. The information on the roadmap and future software development efforts are intended to outline general product direction and should not be relied on in making a purchasing decision. For more information on the Accelrys Tech Summits and other IT & Developer information, please visit: https://community.accelrys.com/groups/it-dev