Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc

Embed Size (px)

Citation preview

  • Slide 1

Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide Peter Eberhardt Fernwood Consulting Group Inc. Slide 2 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Agenda Introduction Demo Requirements Getting Started Interfaces Examples Wrap-up Slide 3 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction History of SAS and open environment What is a custom add-in How does an add-in compare to a SP Slide 4 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction Pre v8 Multi-Platform Stand alone Slide 5 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction v8 IOM Opened SAS Slide 6 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction v9 Studios DI, Cube Studio Java client Slide 7 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction Enterprise Guide 4.1.NET application Integration into MS Office SAS is too hard to use Drag-and-Drop Interface Project oriented SAS Tasks encapsulate underlying PROC syntax Process flows link Tasks and Data Slide 8 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction SAS Enterprise Guide SAS on Windows SAS on Mainframe SAS on UNIX Code Results Slide 9 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction An Enterprise Guide project can be thought of as a basket, or container: Healthcare To which you assign a name In which you place data source(s) Within which you define tasks Slide 10 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction Interfaces Part 1 EG Custom Add-in Tasks Friendly front-end to a existing SAS programmes Access SAS and non-SAS resources Package SAS PROCS not part of EG Slide 11 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Introduction Interfaces SAS Stored Process SAS programme that is centrally managed Two components Metadata programme Runs on a server Simple user interface Slide 12 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Agenda Introduction Demo Requirements Getting Started Interfaces Examples Wrap-up Slide 13 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Agenda Introduction Demo Requirements Getting Started Interfaces Examples Wrap-up Slide 14 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Requirements Fundamentals Visual Studio.NET Framework v1.1 EG 4.1 A problem or solution Slide 15 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Requirements Implement Interfaces Slide 16 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Main Entry: interface Pronunciation: 'in-t&r-"fAs Function: noun 1 : a surface forming a common boundary of two bodies, spaces, or phases 2 a : the place at which independent and often unrelated systems meet and act on or communicate with each other b : the means by which interaction or communication is achieved at an interface - interfacial /"in-t&r-'fA-sh&l/ adjectiveinteraction Slide 17 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Main Entry: interaction Pronunciation: "in-t&r-'ak-sh&n Function: noun : mutual or reciprocal action or influence - interactional /-shn&l, -sh&-n & l/ adjective Slide 18 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Requirements Interfaces Part 2 Separates the name of a method from its implementation Contract between your programme and SAS Slide 19 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Agenda Introduction Demo Requirements Getting Started Interfaces Examples Wrap-up Slide 20 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Getting Started Project templates Available from the SAS site Adds a new project type to Visual Studio Creates a project with the required interfaces Slide 21 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Getting Started Rules to Remember in Visual Studio The project name and directory When you create the new project Rename the default files and classes CustomTask1, CustomTaskForm1 Change the properties of the add-in reference Change the strings in ISASTaskDescription Search for PLACEHOLDER Slide 22 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Getting Started Demo Slide 23 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.New project Slide 24 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 2 1.Project Type 2.SAS EG 4 AddIn (from SAS template) 3.Project Name and Location 3 Slide 25 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Default File Names need to be changed Slide 26 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Names in the project need to be changed Slide 27 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.References 2.Local Copy property set to FALSE 2 Slide 28 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Project Properties Slide 29 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Configuration Properties set Debug Mode to Program NOTE: click Apply after changing the Debug Mode to un-grey the Start Program property Slide 30 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Configuration Properties Navigate to your EG executable Slide 31 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Change the descriptions in the source code Slide 32 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Strings are changed Slide 33 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Build the project Slide 34 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Demo creating a project 1 1.Success!! Slide 35 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Agenda Introduction Demo Requirements Getting Started Interfaces Examples Wrap-up Slide 36 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces Separates the name of a method from its implementation Contract between your programme and SAS Slide 37 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces You agree you will implement ISASTaskAddin ISASTaskDescription ISASTask You can implement if you want ISASTaskSubmitSink ISASTaskDataSink Slide 38 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskAddin This connects the application (i.e. Enterprise Guide) to your Add-in. It provides basic information back to EG. EG will not recognize your add-in if you do not implement this interface. The template automatically creates all the members of the interface for you. Slide 39 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskDescription This interface is used by the application to determine basic task information which is not dependent on the task state. ISASTaskDescription2 is an optional extension of this interface with a few additional properties for advanced features. Implement one or the other Slide 40 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces - ISASTask Public Properties Label The label of an instance of the task as it appears in the project. Both a property set and a property get have to be implemented OutputDataCount The number of output datasets the task expects to create. Only a property get has to be implemented Slide 41 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTask This interface is used by the application to control the runtime state of the add-in Slide 42 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTask2 Extends ISASTask with additional properties and methods Implement SASTask OR SASTask2 Slide 43 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces Properties ISASTaskAddin ISASTaskDescription ISASTask You can implement if you want ISASTaskSubmitSink ISASTaskDataSink Slide 44 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskSubmitSink Supplies notifications to the add-in that the input data has changed, or that it needs to take some action regarding output data that it intends to create. Slide 45 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskDataSink Supplies notifications to the add-in that the input data has changed, or that it needs to take some action regarding output data that it intends to create. Slide 46 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces SAS agrees to implement ISASTaskConsumer ISASTaskData ISASTaskDataAccessor ISASTaskDataDataColumn SAS agrees it might implement ISASTaskSubmit ISASTaskUtilities Slide 47 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskConsumer Provides information about what the application supports and access to other supported interfaces. Also provides access to options specific to the particular instance of the add-in. The implementation of this interface by a host application is required, although not all properties and methods are required to be supported. Slide 48 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskData These interfaces allow the task to obtain information about the active data. Different host applications might not be able to provide values for some of these methods. Slide 49 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskDataAccessor These methods allow the task to access the data values in a specific data object. Slide 50 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskDataColumn Provides information about a single column in a data source Slide 51 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces SAS agrees to implement ISASTaskConsumer ISASTaskData ISASTaskDataAccessor ISASTaskDataDataColumn SAS agrees it might implement ISASTaskSubmit ISASTaskUtilities Slide 52 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskSubmit This interfaces allow the task to submit SAS code from within the task. Slide 53 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces ISASTaskUtilities This interfaces allow the task to surface some utility functionality to the task. Slide 54 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Interfaces Examples Slide 55 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Recap Download the Templates from SAS Create the initial project Change the default name and location of the project Change the string descriptors sFriendlyName etc Set the Copy Local property to false Compile the project Slide 56 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Recap Set the options for the project debug using program Compile and step through with the debugger Register the add-in with the Add-in manager Make sure it runs Slide 57 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Recap Do your thing!! Change code Compile Debug Copy completed DLL to the deployment folder C:\Program Files\SAS\Shared Files\BIClientTasks\Custom Slide 58 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Recap Go for a beverage of your choice to celebrate a job well done Slide 59 Separating the Interface from the Engine: Creating Custom Add-in Tasks for Enterprise Guide Peter Eberhardt, Fernwood Consulting Group Copyright 2007, SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. [email protected]