Project and Portfolio Management Practitioners Forum
cancel

Nested tokens

SOLVED
Go to solution
Highlighted
Łukasz Czech
Super Contributor.

Nested tokens

Hi,

I'm trying to retrieve another request data from within request when the request from where I want to retrieve data is chosen in request form. Example
REQ1
Field req2 id
Field dest
REQ2
Field source

I want to obtain value of field source and put it in Field dest. I want to use nested tokens for that (can do it with ksc_run_sql).

I've tried:
1. TEMP_PARAM="[TEMP_PARAM2="Release 18".P.GEMB_REL_BR_APPROVAL]"
Gives error - (KNTA-10127) Wrong number of parameters.

2. TEMP_PARAM=[TEMP_PARAM2="[REQD.VP.GEMB_RELEASE_RES_ALLOCATI]".P.GEMB_REL_BR_APPROVAL]
Sets TEMP_PARAM value to [TEMP_PARAM2="".P.GEMB_REL_BR_APPROVAL] (string)

3. TEMP_PARAM="[REQD.VP.GEMB_RELEASE_RES_ALLOCATI]".P.GEMB_REL_BR_APPROVAL
Sets no value to TEMP_PARAM

Any ideas how the syntax should be?

Thank you
Lukasz Czech
7 REPLIES
Erik Cole_1
Outstanding Contributor.

Re: Nested tokens

Is [REQD.VP.GEMB_RELEASE_RES_ALLOCATI] a field on the current request that contains the Request_Id of the request you're trying to get a value from?

If I understand what you're trying to do, you can use a rule with SQL like:

Select ParameterX, Visible_ParameterX
From KCRT_REQUEST_DETAILS
Where REQUEST_ID = [REQD.P.GEMB_RELEASE_RES_ALLOCATI]
{and BATCH_NUMBER = X if req'd}
Łukasz Czech
Super Contributor.

Re: Nested tokens

Hi Erik,

I do not want to use SQL (I have solution using SQL). I want to use nested tokens instead as described in Commands, Tokens, and Validations Guide and Reference (p. 50) example: [USR="[USR="[REQ.CREATED_BY_NAME]".VUD.MANAGER]".EMAIL_ADDRESS]
but I can't get it work with ksc_store command.
Michael.Ebert
Super Contributor.

Re: Nested tokens

Hi Lukasz,

try this one:
TEMP_PARAM=[REQD="[REQD.VP.GEMB_RELEASE_RES_ALLOCATI]".P.GEMB_REL_BR_APPROVAL]

This will take the value of the local token GEMB_RELEASE_RES_ALLOCATI, use it as request id, and get the token GEMB_REL_BR_APPROVAL of the referenced request.

Kind regards,
Michael
Łukasz Czech
Super Contributor.

Re: Nested tokens

Hi,

I've got following error:

KSC Set

Source Command: Business Solution - Release Date

TEMP_PARAM=[REQD="Release 18".P.GEMB_REL_BR_APPROVAL]
Succeeded
The following Command Step is not subject to timing out: com.kintana.core.server.execution.CLStoreCommand

KSC Store

Source Command: Business Solution - Release Date

ERROR while parsing text.
KNTA_EXECUTION.PARSE_TEXT_FOR_EXECUTION(
1: VARCHAR P_TEXT
2: INTEGER P_WORKFLOW_ID
3: INTEGER P_WORKFLOW_STEP_ID
4: INTEGER P_SOURCE_ENVIRONMENT_ID
5: INTEGER P_DEST_ENVIRONMENT_ID
6: INTEGER P_PACKAGE_ID
7: INTEGER P_PACKAGE_LINE_ID
8: VARCHAR P_APP_CODE
9: INTEGER P_REQUEST_ID
10: INTEGER P_REQUEST_DETAIL_ID
11: INTEGER P_REPORT_SUBMISSION_ID
12: INTEGER P_DISTRIBUTION_ID
13: INTEGER P_RELEASE_ID
14: INTEGER P_PROJECT_ID
15: INTEGER P_TASK_ID
16: VARCHAR P_PARAMETER_PREFIX
17: INTEGER P_LAST_UPDATED_BY
18: VARCHAR P_SERVER_NAME
19: INTEGER P_USR_DBG
20: INTEGER O_MESSAGE_TYPE
21: VARCHAR O_MESSAGE_NAME
22: VARCHAR O_MESSAGE

O_MESSAGE : value: ORA-01722: invalid number {KNTA_TOKEN_PRIVATE-200}

SELECT REQUEST_ID FROM KCRT_REQUEST_DETAILS WHERE REQUEST_ID = :P_ENTITY_NAME sqlType: VARCHAR
P_TEXT : value: [REQD="Release 18".P.GEMB_REL_BR_APPROVAL] sqlType: VARCHAR
O_MESSAGE_NAME: value: ORACLE_ERROR sqlType: VARCHAR
O_MESSAGE_TYPE: value: 20 sqlType: INTEGER

An HP internal error has occurred. Please contact HP Project and Portfolio Management support if the problem persists. (KNTA-10023) DB Package error:

ORA-01722: invalid number {KNTA_TOKEN_PRIVATE-200}
Erik Cole_1
Outstanding Contributor.
Solution

Re: Nested tokens

Lukasz,

There's no Request_Deatail token in a Request context, ie. REQ.REQ_DETAIL_ID so I don't think you can so this given just a request Id.

If when a user picks a request you also store the request's detail id, then Michael's token should work but you would have to change it to reference that request detail field and use P instead of VP.
Łukasz Czech
Super Contributor.

Re: Nested tokens

Hi,

after Erik's comment and adding quotes - it works:
ksc_set TEMP_PARAM="[REQD="[REQD.P.GEMB_RELEASE_RES_ALLOCATI]".P.GEMB_REL_BR_APPROVAL]"
ksc_store REQD.P.GEMB_PROJ_REL_BUS_SOL_END_DATE="[TEMP_PARAM]","[TEMP_PARAM]"

Thank you!

Lukasz Czech
Łukasz Czech
Super Contributor.

Re: Nested tokens

Closing