1

I have a unix shell script which allows me to create ucm projects from the command line (so I don't have to recall all the switches and can do it all in one shot (project, integration stream, dev stream, etc.)).

I can call mkproject.sh myproject-1@/vobs/my_pvob and it does almost all the hard work for me, including setting all the policies.

The one thing I have not been able to find out from the documentation is how to enable the ClearQuest policies, specifically "Transition to Complete After Delivery" flag.

Any suggestions on how to accomplish this?

relevant portion of mkproject.sh below:

cleartool mkproject -c "${PROJ_NAME}" \
 -in RootFolder@${PVOB} -model DEFAULT \
 -blname_template "component,date,time,basename" \
 -policy ${POLICY} -npolicy ${NEG_POLICY} \
 -crmenable ${CQ_USER_DB} -connection ${CQ_DB_CNXN} \
 -modcomp ${COMP_LIST} ${PROJ_NAME}@${PVOB} || \
    msg FATAL "error creating project ${PROJ_NAME}@${PVOB}"

where:

POLICY='POLICY_INTRAPROJECT_DELIVER_FOUNDATION_CHANGES,POLICY_INTERPROJECT_DELIVER,POLICY_INTERPROJECT_DELIVER_FOUNDATION_CHANGES,POLICY_INTERPROJECT_DELIVER_ALLOW_NONMOD_TGTCOMPS,POLICY_REBASE_CO,POLICY_CHSTREAM_UNRESTRICTED,POLICY_UNIX_INT_SNAP' NEG_POLICY='POLICY_DELIVER_NCO_DEVSTR,POLICY_DELIVER_NCO_SELACT,POLICY_DELIVER_REQUIRE_REBASE,POLICY_INTRAPROJECT_DELIVER_ALLOW_MISSING_TGTCOMPS,POLICY_INTERPROJECT_DELIVER_REQUIRE_TGTCOMP_VISIBILITY,POLICY_CHPROJECT_UNRESTRICTED,POLICY_WIN_DEV_SNAP,POLICY_WIN_INT_SNAP,POLICY_UNIX_DEV_SNAP'

I suspect there is some post mkproject command I need to run. Your help is most appreciated.

Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
Ian W
  • 4,559
  • 2
  • 18
  • 37

1 Answers1

0

I suspect, as indicated in "When to use Rational ClearQuest scripts instead of UCM triggers", that you need to enable the ClearQuest link first.
See cleartool mkproject:

 –crm/enable ClearQuest-user-database-name [–con/nection crm-connection ]

Then, any ClearQuest policy could be enabled, like the ones listed in "Customizing Rational ClearQuest project policies", which includes UCM_CQActAfterDeliver_Def.
It represents the default action which transitions to complete after delivery: see "Functionally of the UCM-ClearQuest Integration policies"

REM Start of Global Script UCM_CQActAfterDeliver_Def

Function UCM_CQActAfterDeliver_Def (entity_type, entity_id)

' This implements the default behavior when the "Do ClearQuest
' Action After Delivery" policy is enabled: It attempts to transition
' the entity to a Complete-type state, using default actions. Note that
' any missing mandatory fields for the Complete-type state will cause
' this script to fail.
'
' INPUT:
'  - entity_type: type of entity on which action will be executed
'  - entity_id: id (e.g. "SAMPL0000001") of entity on which action will be
'     executed
' OUTPUT:
'  - If the action was successfully executed, this returns an empty string
'  - If the action was not successfully executed, this returns a string
'    to be displayed as an error message.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • VonC,perhaps my question was not clear or am missing something.We now set up the project, streams, project policies, CQ enable and enable the CQ policy flag via GUI and all works well. I am trying to achieve the same thing via command-line/script to automate project creation. The enable CQ specific policies is the only piece I am missing. I don't believe I can set it via a parameter to "-policy" and can't see any other option. CM Crossroads has a post which suggests this is not possible,except via GUI.If not on the command line, do I use perl/CQ API to enable the flag on the project? – Ian W Nov 04 '12 at 09:24
  • The IBM presentation IBM Rational ClearCase-ClearQuest UCM integration [link](http://publib.boulder.ibm.com/infocenter/ieduasst/rtnv1r0/index.jsp?topic=/com.ibm.iea.rcc/rcc/7.0/Operations/ucm_cq_/player.html) , slide 38 also suggests this is not possible under 7.0 (using 8.0). What about via CQ API? – Ian W Nov 04 '12 at 09:34
  • @IanW you mean if you create an UCM project with the -crm and -conn options, the resulting project won't be CQ-enabled? As for `UCM_CQActAfterDeliver_Def`, I didn't see a way to set it directly during project creation. And the CQ API isn't aware of ClearCase, as far as I know. – VonC Nov 04 '12 at 10:06
  • The project will be UCM enabled, it just does not have the flags set. I can enable the flags via the CC GUI by clicking on the project properties within clearprojexp. I can also enable the flags from within the ClearQuest fat client by clicking on the project and editing them in the Policies tab. That's why I mentioned the CQ API. I just can't figure out how to achieve this without involving the GUI. – Ian W Nov 05 '12 at 06:30