Introduction to  Synergy CLI Yaron Zelichover February 2010
<ul><li>Agenda </li></ul><ul><li>CLI usage </li></ul><ul><li>Starting a CLI session -  ccm start </li></ul><ul><li>Attribu...
<ul><li>Purpose </li></ul><ul><li>How to use CLI as a way to improve Synergy usage in your organization </li></ul><ul><li>...
<ul><li>Starting a CLI session – ‘ccm start’ </li></ul><ul><li>CLI requires Synergy session of classic UI </li></ul><ul><l...
<ul><li>Attributes and Relations </li></ul><ul><li>Attributes  on objects: name, owner, create_time, etc… </li></ul><ul><l...
<ul><li>Attribute command – ‘ccm attr’ (1) </li></ul><ul><li>List/list-all/show object’s attribute/s </li></ul><ul><ul><ul...
<ul><li>Attribute command – ‘ccm attr’ (2) </li></ul><ul><li>Example: Define CR mandatory on Tasks </li></ul><ul><ul><li>T...
<ul><li>Relate command – ‘ccm relate’ (1) </li></ul><ul><li>Showing relationships to and from an object </li></ul><ul><ul>...
<ul><li>Relate command – ‘ccm relate’ (2) </li></ul><ul><li>Creating a relationship from one object to another </li></ul><...
<ul><li>Query command – ‘ccm query’ </li></ul><ul><li>ccm query [-o owner] [-t type] [-f format] [-u] [query_string] </li>...
<ul><li>Types of Queries (1) </li></ul><ul><li>Queries Using Attribute Value Clauses </li></ul><ul><ul><li>&quot; attr_nam...
<ul><li>Types of Queries (2) </li></ul><ul><li>Time-Based Queries </li></ul><ul><ul><ul><li>Relative time:  +/-days:hours:...
<ul><li>Types of Queries (3) </li></ul><ul><li>Queries on few Clauses using logic gates </li></ul><ul><ul><ul><li>&quot; n...
<ul><li>Types of Queries (4) </li></ul><ul><li>Query for Related Objects </li></ul><ul><ul><li>is_ relationship-name _of( ...
<ul><li>Additional commands (1) </li></ul><ul><li>Showing source contents </li></ul><ul><ul><li>Cat command – ‘ccm cat’ </...
<ul><li>Additional commands (2) </li></ul><ul><li>Execute Synergy commands found in a file </li></ul><ul><ul><li>Source co...
<ul><li>Additional commands (3) </li></ul><ul><li>Typedef command </li></ul><ul><ul><ul><li>Create/ Modify existing type <...
<ul><li>Additional commands (4) </li></ul><ul><li>Add/remove users or change permissions – ‘ccm users’ command </li></ul><...
<ul><li>CLI Help </li></ul><ul><li>Synergy menu help </li></ul><ul><ul><ul><li>Help > Project View </li></ul></ul></ul><ul...
Thank You
Upcoming SlideShare
Loading in …5
×

Synergy CLI

5,671 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,671
On SlideShare
0
From Embeds
0
Number of Embeds
115
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • 02/16/10 11:56
  • Synergy CLI

    1. 1. Introduction to Synergy CLI Yaron Zelichover February 2010
    2. 2. <ul><li>Agenda </li></ul><ul><li>CLI usage </li></ul><ul><li>Starting a CLI session - ccm start </li></ul><ul><li>Attributes and Relations </li></ul><ul><li>Queries </li></ul><ul><ul><ul><li>Query command </li></ul></ul></ul><ul><ul><ul><li>Query types </li></ul></ul></ul><ul><li>Additional commands: </li></ul><ul><ul><ul><li>Showing source contents </li></ul></ul></ul><ul><ul><ul><li>Execute Synergy commands found in a file </li></ul></ul></ul><ul><ul><ul><li>Typedef / Users/ Delim </li></ul></ul></ul>Synergy CLI
    3. 3. <ul><li>Purpose </li></ul><ul><li>How to use CLI as a way to improve Synergy usage in your organization </li></ul><ul><li>Usage of Synergy CLI </li></ul><ul><li>Automations of CM processes (builds, branching, etc…) </li></ul><ul><li>Complex queries </li></ul><ul><li>Objects manipulation (attributes, relations) </li></ul><ul><li>Administration and maintenance </li></ul>Synergy CLI
    4. 4. <ul><li>Starting a CLI session – ‘ccm start’ </li></ul><ul><li>CLI requires Synergy session of classic UI </li></ul><ul><li>> ccm start [-q] [-d database_path] [-h Engine_host] </li></ul><ul><li> [-n username] [-pw password] [-r initial_role] </li></ul><ul><li> [-m] [-nogui ] [–u pathname] [-home homedir] </li></ul><ul><li>CCM_ADDR env. variable </li></ul><ul><li>> ccm stop </li></ul>Synergy CLI
    5. 5. <ul><li>Attributes and Relations </li></ul><ul><li>Attributes on objects: name, owner, create_time, etc… </li></ul><ul><li>Relations between objects: </li></ul><ul><ul><ul><li>From a task to a source object (associated_cv) </li></ul></ul></ul><ul><ul><ul><li>From a versioned object to its history successor (successor) </li></ul></ul></ul><ul><ul><ul><li>From CR to associated task (associated_task) </li></ul></ul></ul><ul><ul><ul><li>… </li></ul></ul></ul>Synergy CLI
    6. 6. <ul><li>Attribute command – ‘ccm attr’ (1) </li></ul><ul><li>List/list-all/show object’s attribute/s </li></ul><ul><ul><ul><li>ccm attr -l|-la file_spec </li></ul></ul></ul><ul><ul><ul><li>ccm attr -s attr_name file_spec </li></ul></ul></ul><ul><li>Modify object’s attribute </li></ul><ul><ul><ul><li>ccm attr -m attr_name -v value file_spec </li></ul></ul></ul><ul><li>Create object’s attribute </li></ul><ul><ul><ul><li>ccm attr -c attr_name -t type [-v value] file_spec </li></ul></ul></ul><ul><li>Example: </li></ul><ul><ul><ul><li>ccm attr -l task50~1:task:probtrac </li></ul></ul></ul>Synergy CLI
    7. 7. <ul><li>Attribute command – ‘ccm attr’ (2) </li></ul><ul><li>Example: Define CR mandatory on Tasks </li></ul><ul><ul><li>To set this up just query for the 'task' cvtype: </li></ul></ul><ul><ul><ul><li>> ccm query –n task –t cvtype </li></ul></ul></ul><ul><ul><ul><li>1) base/cvtype/task/1 ac_rel ccm_root cvtype <void> base <void> </li></ul></ul></ul><ul><ul><li>Set role to ccm_admin: </li></ul></ul><ul><ul><ul><li>> ccm set role ccm_admin </li></ul></ul></ul><ul><ul><li>Create the attribute 'required_attributes', type text if it doesn't exist. </li></ul></ul><ul><ul><ul><li>> ccm attr -c required_attributes -t text @ </li></ul></ul></ul><ul><ul><li>Open the attribute for modify: </li></ul></ul><ul><ul><ul><li>> ccm attr –m required_attributes @ </li></ul></ul></ul><ul><ul><li>Add 'change_request' on its own line. </li></ul></ul><ul><ul><li>Restart the session. </li></ul></ul>Synergy CLI
    8. 8. <ul><li>Relate command – ‘ccm relate’ (1) </li></ul><ul><li>Showing relationships to and from an object </li></ul><ul><ul><li>ccm relate -s [-n relationship_name] -f|-t object_spec </li></ul></ul><ul><ul><ul><li>Example: >ccm relate -s -n associated_cv -f task50~1:task:probtrac </li></ul></ul></ul>Synergy CLI
    9. 9. <ul><li>Relate command – ‘ccm relate’ (2) </li></ul><ul><li>Creating a relationship from one object to another </li></ul><ul><ul><li>ccm relate -n relationship_name -f from_object_spec -t to_object_spec </li></ul></ul><ul><ul><ul><li>ccm relate -n successor -f print.c~5.1.1:csrc:1 -t print.c~6:csrc:1 </li></ul></ul></ul><ul><li>Deleting a relationship between two objects </li></ul><ul><ul><li>ccm unrelate -n relationship_name -f from_object_spec -t to_object_spec </li></ul></ul><ul><ul><ul><li>ccm unrelate -n successor -f print.c~5.1.1:csrc:1 -t print.c~6:csrc:1 </li></ul></ul></ul>Synergy CLI
    10. 10. <ul><li>Query command – ‘ccm query’ </li></ul><ul><li>ccm query [-o owner] [-t type] [-f format] [-u] [query_string] </li></ul><ul><li>Redirection query results to a file </li></ul><ul><ul><li>>ccm query … >> file_path </li></ul></ul>Synergy CLI
    11. 11. <ul><li>Types of Queries (1) </li></ul><ul><li>Queries Using Attribute Value Clauses </li></ul><ul><ul><li>&quot; attr_name relative_operator ’ constant’ “ </li></ul></ul><ul><ul><ul><ul><li>ccm query “abc=’test’ ” </li></ul></ul></ul></ul><ul><ul><ul><ul><li>ccm query “abc match ‘*test*’ ” </li></ul></ul></ul></ul><ul><li>Queries Using Function Test Clauses </li></ul><ul><ul><li>&quot; function (’ function_arguments ’)&quot; </li></ul></ul><ul><ul><ul><ul><li>ccm query “has_attr(‘abc’)” </li></ul></ul></ul></ul><ul><ul><ul><ul><li>ccm query “is_member_of(‘projname-version’)” </li></ul></ul></ul></ul>Synergy CLI
    12. 12. <ul><li>Types of Queries (2) </li></ul><ul><li>Time-Based Queries </li></ul><ul><ul><ul><li>Relative time: +/-days:hours:minutes:seconds </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Query for all objects that were created in the last 10 days </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>> ccm query &quot;create_time > time('-10:0:0:0')&quot; </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Absolute date </li></ul></ul></ul><ul><ul><ul><ul><ul><li>Query for all objects that have been modified after Feb 14 th </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>> ccm query &quot;modify_time >time('02/14/2010')&quot; </li></ul></ul></ul></ul></ul><ul><ul><ul><li>Tip: Use ‘Change’ to see examples of time-based queries </li></ul></ul></ul>Synergy CLI
    13. 13. <ul><li>Types of Queries (3) </li></ul><ul><li>Queries on few Clauses using logic gates </li></ul><ul><ul><ul><li>&quot; not query_clause “ </li></ul></ul></ul><ul><ul><ul><ul><li>>ccm query &quot;not is_bound()&quot; </li></ul></ul></ul></ul><ul><ul><ul><li>&quot; query_clause and|or query_clause &quot; </li></ul></ul></ul><ul><ul><ul><ul><li>>ccm query “is_bound() and modify_time < time(’Fri Dec 12 2009’)&quot; </li></ul></ul></ul></ul>Synergy CLI
    14. 14. <ul><li>Types of Queries (4) </li></ul><ul><li>Query for Related Objects </li></ul><ul><ul><li>is_ relationship-name _of( objectname ) </li></ul></ul><ul><ul><ul><ul><li>Example: >ccm query &quot;is_successor_of('compiling.cmd~3:cmd:1')“ </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>1) compiling.cmd~4 </li></ul></ul></ul></ul></ul><ul><ul><li>has_ relationship-name ( objectname ) </li></ul></ul><ul><ul><ul><ul><li>Example: >ccm query &quot;has_successor('compiling.cmd~3:cmd:1')&quot; </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>1) compiling.cmd~2 </li></ul></ul></ul></ul></ul><ul><li>Nested Queries </li></ul><ul><ul><li>“ A query within a query” </li></ul></ul><ul><ul><ul><li>ccm query -t problem &quot;(has_associated_task(cvtype='task' and status ='task_assigned' and resolver='user_name'))&quot;  </li></ul></ul></ul>Synergy CLI
    15. 15. <ul><li>Additional commands (1) </li></ul><ul><li>Showing source contents </li></ul><ul><ul><li>Cat command – ‘ccm cat’ </li></ul></ul><ul><ul><ul><li>>ccm cat build.bat~1:shsrc:2 </li></ul></ul></ul><ul><ul><li>Ccm attr –s source file_spec </li></ul></ul><ul><ul><ul><li>>ccm attr -s source build.bat~1:shsrc:2 </li></ul></ul></ul>Synergy CLI
    16. 16. <ul><li>Additional commands (2) </li></ul><ul><li>Execute Synergy commands found in a file </li></ul><ul><ul><li>Source command – ‘ccm source’ </li></ul></ul><ul><ul><ul><li>>ccm source ccm_product_cleanup </li></ul></ul></ul><ul><ul><ul><li>The ccm_product_cleanup file contains the following commands: </li></ul></ul></ul><ul><ul><ul><ul><ul><li>set role ccm_admin </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>query /type executable &quot;not is_bound()&quot; </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>collapse @ </li></ul></ul></ul></ul></ul>Synergy CLI
    17. 17. <ul><li>Additional commands (3) </li></ul><ul><li>Typedef command </li></ul><ul><ul><ul><li>Create/ Modify existing type </li></ul></ul></ul><ul><ul><ul><ul><li>ccm typedef jpeg /d &quot;JPEG Image&quot; /s binary /fw &quot;.jpeg .jpg&quot; /fu &quot;.jpeg .jpg&quot; </li></ul></ul></ul></ul><ul><ul><ul><li>Import type from a file to a Synergy db </li></ul></ul></ul><ul><ul><ul><ul><li>ccm typedef /import fmdoc /dir c: ypes_to_import </li></ul></ul></ul></ul><ul><ul><ul><li>Export type from Synergy db to a file </li></ul></ul></ul><ul><ul><ul><ul><li>ccm typedef /export pascal /dir &quot;c:exported types&quot; </li></ul></ul></ul></ul>Synergy CLI
    18. 18. <ul><li>Additional commands (4) </li></ul><ul><li>Add/remove users or change permissions – ‘ccm users’ command </li></ul><ul><ul><li>>ccm users </li></ul></ul><ul><ul><ul><ul><li>user erin = developer ccm_admin; user heather = writer; user matt = developer build_mgr ccm_admin; </li></ul></ul></ul></ul><ul><li>Change the value of the delimiter character – ‘ccm delim’ command </li></ul><ul><ul><li>>ccm delim “~” </li></ul></ul>Synergy CLI
    19. 19. <ul><li>CLI Help </li></ul><ul><li>Synergy menu help </li></ul><ul><ul><ul><li>Help > Project View </li></ul></ul></ul><ul><li>“ IBM Rational Synergy CLI Help” – pdf manual </li></ul><ul><li>Examples of 'ccm query' Syntax: </li></ul><ul><li>http://www-01.ibm.com/support/docview.wss?uid=swg21325217 </li></ul>Synergy CLI
    20. 20. Thank You

    ×