Www.regouniversity.com Clarity Educational Community Updates and Automation Getting Started with GEL Scripts Presented by : Virginia DeCeglia & Chris Shaffer.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
The Power of GEL Scripting to Enhance Functionality
Interface Strategies and Methods.
Clarity Educational Community Clarity Educational Community Integration Interface Strategies and Methods.
1 Chapter 12 Working With Access 2000 on the Internet.
1 HTML Markup language – coded text is converted into formatted text by a web browser. Big chart on pg. 16—39. Tags usually come in pairs like – data Some.
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Tutorial 11: Connecting to External Data
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
Creating a Web Page HTML, FrontPage, Word, Composer.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
MS Access Advanced Instructor: Vicki Weidler Assistant:
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Sage CRM Developers Course
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
JSP Standard Tag Library
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Advanced Web 2012 Lecture 4 Sean Costain PHP Sean Costain 2012 What is PHP? PHP is a widely-used general-purpose scripting language that is especially.
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Clarity Educational Community Enhanced Functionality and Integration Advanced GEL Scripts Presented by: James Gille | Date Prepared:
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Introduction to HTML. What is a HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup tags  The.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Tom Castiglia Hershey Technologies
Tutorial 10 Programming with JavaScript
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Using Client-Side Scripts to Enhance Web Applications 1.
Oracle Data Integrator Procedures, Advanced Workflows.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Web Development 101 Presented by John Valance
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Agenda for Class 2/20/2014 Introduce Microsoft’s SQL Server database management system. Use the lab to discuss how to CREATE, DROP and populate (INSERT)
Chapter 12© copyright Janson Industries Java Server Faces ▮ Explain the JSF framework ▮ SDO (service data objects) ▮ Facelets ▮ Pagecode classes.
1 HTML Forms
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Web Database Programming Using PHP
Visual Basic 2010 How to Program
z/Ware 2.0 Technical Overview
Web Database Programming Using PHP
Introduction to Scripting
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
BASIC PHP and MYSQL Edward S. Flores.
Intro to PHP & Variables
PHP.
Web DB Programming: PHP
Lecture 5: Functions and Parameters
Tutorial 6 PHP & MySQL Li Xu
Presentation transcript:

Clarity Educational Community Updates and Automation Getting Started with GEL Scripts Presented by : Virginia DeCeglia & Chris Shaffer

2 Clarity Educational Community Agenda Overview Introducing GEL Scripting Scripting Exercises Q&A

3 Clarity Educational Community Prerequisites Basic knowledge creating CA PPM processes Oracle/SQL language CA PPM data model

4 Clarity Educational Community Power of Automation Time Spent Task Size Non-Geek Geek Does it manually Gets annoyed Writes script to automate Makes fun of geek’s complicated method Runs script Wins Loses

5 Clarity Educational Community What is GEL? GEL stands for Generic Execution Language Based on Jelly, a jakarta.apache.org Commons project Extended and embedded into CA PPM to enable custom logic to solve business problems GEL is the basis for the enterprise application integration framework within CA PPM GEL scripts can be executed from within CA PPM by installing them as processes, or from the command line GEL scripts are executed top down

6 Clarity Educational Community What is GEL?, cont. Additional information can be found in the CA Documentation (CAClarityPPM_XOG_DeveloperGuide_ENU.pdf) and at the Apache Jelly website at

7 Clarity Educational Community GEL Data Sources Web Services – GEL can read or write to any SOAP based web service including XOG File System – GEL can read or write to any delimited file accessible on the application server FTP – GEL can upload or download to FTP servers JDBC – GEL uses JDBC to read and write to databases

8 Clarity Educational Community GEL Script Structure <gel:script xmlns:SOAP-ENV=" xmlns:core="jelly:core" xmlns:gel="jelly.com.niku.union.gel.GELTagLibrary" xmlns:file="jelly.com.niku.union.gel.FileTagLibrary" xmlns:soap=" jelly.com.niku.union.gel.SOAPTagLibrary" xmlns:soapenv=" xmlns:sql="jelly.sql" xmlns:xog=" xmlns:xsd=" xmlns:xsi=" Header Comment Footer

9 Clarity Educational Community Header – Tag Namespaces Header contains GEL namespace A GEL script is built from qualified elements bound to java code called tags Tags are organized into tag libraries that dictate what can be used in the script CA PPM ships with many out of the box tag libraries.

10 Clarity Educational Community Header – Tag Namespaces, cont. <gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary" xmlns:soapenv=" xmlns:sql="jelly:sql" xmlns:xog=" xmlns:xsd=" xmlns:xsi="

11 Clarity Educational Community Tags Tags are grouped in pairs, similar to HTML – – Each tag should have a closing tag Tag name comes from the library definition – xmlns:core="jelly:core" Core, SQL, GEL are most common libraries Syntax

12 Clarity Educational Community Logging The gel:log tag allows for logging of messages viewable from the CA PPM application You can declare the log to be INFO (Yellow flag) or WARN (Red X) Syntax Log Message

13 Clarity Educational Community Comments Commenting your code will save a number of headaches later on. Comment syntax is the same as HTML. Syntax

14 Clarity Educational Community Creating Your First Script – Follow Along Create a process Go to Studio / Processes / New

15 Clarity Educational Community Creating Your First Script, cont. Add Primary Object Select Project object, Save and Return

16 Clarity Educational Community Creating Your First Script, cont. Left click Start Step

17 Clarity Educational Community Creating Your First Script, cont. Create a new action

18 Clarity Educational Community Creating Your First Script, cont. Select Custom Script Click Next

19 Clarity Educational Community Creating Your First Script, cont. Enter action name and id Enter the script into the custom script window <gel:script xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"> My first GEL worked! Validate, then Save and Return

20 Clarity Educational Community Creating Your First Script, cont. Under Post-Conditions, click Select Step Select Finish step, click add

21 Clarity Educational Community Creating Your First Script, cont. Click Save and Return Select the Validation tab

22 Clarity Educational Community Creating Your First Script, cont. Select Validate All and Activate

23 Clarity Educational Community Creating Your First Script, cont. 1.Go to project list and select a project 2.Click the Processes tab 3.Select the Available sub-page 4.Select the test script, then click Start

24 Clarity Educational Community Creating Your First Script, cont. 5.Screen flips to initiated processes 6.Click the messages flag 7.Your log entry appears 8.The BPM message shows for each step; this is normal

25 Clarity Educational Community Questions

26 Clarity Educational Community Variables Variables are widely used in GEL scripts Declared at the time of use Most tags can set variables Setting a variable – variable value Reading a variable – ${var_name} Variables are valid for current script only

27 Clarity Educational Community Persisting Variables Persisting a variable allows makes it accessible throughout the entire process Persisted variables are only valid for the initiated instance. variable_value

28 Clarity Educational Community Built-in Variables Each process has three built in variables – ${gel_objectInstanceId} Object instance ID of the instance the process is executing on Great for project or idea processes – ${gel_processId} ID of the Process itself – ${gel_processInstanceId} Process instance ID

29 Clarity Educational Community Process Parameters – Allows passing of values into a GEL script from a CA PPM process Inside the GEL script, you can refer to the parameter as you would any other variable by using ${variablename} The optional attribute secure="true" causes CA PPM to hide the actual value with asterisks (*) in the user interface

30 Clarity Educational Community Case Sensitivity Information contained within GEL tags is case sensitive – For example, if you declare a variable as follows: PRJ – Then reference the variable as follows: ${v_projectid} – PRJ will not output This will not cause an actual error to occur, so you can’t “catch” this error.

31 Clarity Educational Community Add the Database Data Source 1.Add the SQL tag library to the header xmlns:sql="jelly:sql" 2.Add the niku data source at the beginning of the script

32 Clarity Educational Community Multiple Data Sources Adding the var tag to the data source allows for multiple data sources

33 Clarity Educational Community Query the Database Query structure <![CDATA[ SELECT PRNAME from PRTASK ]]> – The VAR is the array this query will be stored as – dataSource is the variable of the data source to be used If only one data source, this tag is not needed – Always wrap sql statements in the CDATA tag so you can use characters

34 Clarity Educational Community Query Parameters Passing parameters <![CDATA[ SELECT PRNAME from PRTASK WHERE PRPROJECTID = ? ]]> – Parameters are in the order of the ? from the query – This creates a bind parameter and is more efficient for the database – Helps with escaped characters and data types.

35 Clarity Educational Community Query Results Two ways to get the data out – By Index (Order of columns) Task Name: ${row[0]} – By column name (Preferred Method) Task Name: ${row.prname}

36 Clarity Educational Community Update Query <![CDATA[ UPDATEodf_ca_project ocp SETocp.rego_appr_date = sysdate WHEREocp.id = ? ]]> The variable ${updateCnt} contains the number of rows the update statement affects Note: Using CDATA tags in update statements is preferred

37 Clarity Educational Community Update Query, cont. Processes often require updating the values of specific attributes – You can to do this is with a SQL Update statement – Keep the following in mind when performing direct database updates Avoid Insert statements – these are best suited for XOG Direct database updates will not trigger a process to start; XOG updates will typically trigger processes to start Avoid updating OOTB tables when possible; using XOG will ensure all CA PPM business rules are followed It is generally safe to update custom attributes with a SQL update (these are typically found in tables beginning with odf_ca) Use extra caution within On-demand environments

38 Clarity Educational Community Delete Query <![CDATA[ DELETE FROM Z_CUSTOM_TABLE WHERE id = ? ]]> The update tag is also used for delete statements

39 Clarity Educational Community Looping – forEach Use forEach to loop through database result sets.. Do something..

40 Clarity Educational Community Looping – While Loop A While Loop can also be create... Do Something.... Don’t forget to update the counter

41 Clarity Educational Community Conditional If/Then Core:if is a simple if/then statement XOG URL: ${xogUrl} Conditional Expressions ==Equals !=Not Equals >Greater Than &lt:Less Than ≥Greater Than or Equal To ≤Less Than or Equal To Operational Expressions ||Or && And

42 Clarity Educational Community Conditional – Core/Choose/Otherwise core:choose allows you to choose the right path Otherwise is the default action when conditions are not met … …

43 Clarity Educational Community Sending GEL can send HTML formatted <gel: fromName="Clarity" subject="Subject Line ${invCode}" to="${to }"> <![CDATA[ Hello, this is bolded ]]> Gel: uses the mail server set up in the CSA To address can be multiple separated by ; – If the address is listed twice it will fail Uses the xmlns: ="jelly: " namespace

44 Clarity Educational Community Sending , cont. can be split up with database queries in the middle <gel: fromName="Clarity" subject="Subject Line ${invCode}" to="${to }"> <![CDATA[ Hello, this is bolded ]]> <![CDATA[ SELECT … PRT.PRPROJECTID = ? ]]> ${row.full_name}

45 Clarity Educational Community Exercise Create an on-demand GEL script on the Project object The GEL script should send a single that contains a list of resources on the project Create the GEL script, and execute it manually on a project Don’t forget to add the data source and namespaces Use your own address

46 Clarity Educational Community Exercise, cont. Namespaces to use xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:sql="jelly:sql" SQL Script to use <![CDATA[ SELECT FULL_NAME FROM PRTEAM PRT INNER JOIN SRM_RESOURCES SRMR ON PRT.PRRESOURCEID = SRMR.ID WHERE PRT.PRPROJECTID = ? ]]>

47 Clarity Educational Community Solution – Shell Create the GEL shell structure with namespaces <gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:sql="jelly:sql">

48 Clarity Educational Community Solution – Data Source Add the Data Source <gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:sql="jelly:sql">

49 Clarity Educational Community Solution – SQL Query Add the SQL query after the data source <![CDATA[ SELECT FULL_NAME FROM PRTEAM PRT INNER JOIN SRM_RESOURCES SRMR ON PRT.PRRESOURCEID = SRMR.ID WHERE PRT.PRPROJECTID = ? ORDER BY FULL_NAME ]]>

50 Clarity Educational Community Solution – Body After the data source <gel: fromName="Clarity" subject="Project Team Members" <![CDATA[ Greetings, the following resources on assigned to the project. ]]>

51 Clarity Educational Community Solution – Loop After the data source <gel: fromName="Clarity" subject="Project Team Members" <![CDATA[ Greetings, the following resources on assigned to the project. ]]> ${row.FULL_NAME}

52 Clarity Educational Community Solution – Completed Script <gel:script xmlns:core="jelly:core" xmlns: ="jelly: " xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:sql="jelly:sql"> SELECT FULL_NAME FROM PRTEAM PRT INNER JOIN SRM_RESOURCES SRMR ON PRT.PRRESOURCEID = SRMR.ID WHERE PRT.PRPROJECTID = ? ORDER BY FULL_NAME <gel: fromName="Clarity" subject="Project Team Members" <![CDATA[ Greetings, the following resources on assigned to the project. ]]> ${row.FULL_NAME}

53 Clarity Educational Community Things to Consider When working with GEL it is important to keep a few things in mind Be careful when hard coding URLs as refreshes from production to non-prod will not automatically update scripts Refreshes can play havoc with processes – Ensure non-prod systems have disabled or update addresses to a dummy address

54 Clarity Educational Community Questions Virginia DeCegilia Chris Shaffer Thank you for your time. Contact US Contact Web Site