The $PMWorkflowName variable returns the value of the Worklet name when used within Worklet instead of the Workflow name
Problem Description
According to PowerCenter documentation, the built-in workflow parameter $PMWorkflowName should return the name of the Workflow when used in Assignment or Decision tasks. However, when using this parameter within a Worklet, it returns the name of the Worklet instead of Workflow in which the Worklet is run.
Solution
This is a known issue and a CR (CR 206396) has been submitted to be addressed in the future releases.
Workaround
You can pass the variable value from a Workflow variable to a Worklet variable under it. Follow the steps below:
Create a Workflow Variable, say $$WF_NM
Use an Assignment Task in the workflow, before the worklet and add this expression: $$WF_NM=$PMWorkflowName
Create a Worklet variable, say $$WF_NM in worklet where you want to use the Workflow name.
Edit the Worklet; under the Variables tab and add the following assignment in the first group: $$WF_NM = $$WF_NM
This would assign the Worklet WF_NM variable with the Value of Workflow WF_NM variable instance.
You can use the $$WF_NM variable instead of $PMWorkflowName variable inside the Worklet to get the name of the Workflow