Create Policy - Create Unique Account ID Generator

Hi,

I’m trying to use the below transform to create a pattern for accountID generation, But however I get below error. Looks like the variable : “ebsUser” is not getting detected in given Pattern.

can we not use custom transform here when we use create Account ID generation?

            "name": "USER_NAME",
            "transform": {
                "attributes": {
                    "name": "Create Unique Account ID"
                },
                "type": "rule"
            },
            "attributes": {
                "template": "$(ebsUser)$(uniqueCounter)",
                "ebsUser": {
                    "attributes": {
                        "input": {
                            "attributes": {
                                "input": {
                                    "attributes": {
                                        "name": "adUpn"
                                    },
                                    "type": "identityAttribute"
                                },
                                "end": {
                                    "attributes": {
                                        "input": {
                                            "attributes": {
                                                "name": "adUpn"
                                            },
                                            "type": "identityAttribute"
                                        },
                                        "substring": "@"
                                    },
                                    "type": "indexOf"
                                },
                                "begin": 0
                            },
                            "type": "substring"
                        }
                    },
                    "type": "upper"
                }
            },
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        }```

ERROR:


Errors
An unexpected error occurred: The application script threw an exception: java.lang.IllegalStateException: Unable to generate an accountID for '1352424085291' on app 'Oracle EBS - Dev'. The resulting account ID was null. BSF info: Create Unique Account ID at line: 0 column: columnNo

Hi @chandramohan27,

The generator you are using makes use of a specific template as shown here. So you are not allowed to make further changes to the transform as this is a rule and it expects certain attributes.

You will probably need to look into the Username generator transform instead.

1 Like

Hi @jesvin90

Thanks for your reply.

When I use this transform, I see the username always starts with uniqueCounter 1, even though the account is not present on target.

           "name": "USER_NAME",
           "transform": {
               "type": "usernameGenerator",
               "attributes": {
                   "sourceCheck": true,
                   "patterns": [
                       "$ebsUser${uniqueCounter}"
                   ],
                   "ebsUser": {
                       "attributes": {
                           "input": {
                               "type": "substring",
                               "attributes": {
                                   "begin": 0,
                                   "end": {
                                       "type": "indexOf",
                                       "attributes": {
                                           "input": {
                                               "attributes": {
                                                   "name": "adUpn"
                                               },
                                               "type": "identityAttribute"
                                           },
                                           "substring": "@"
                                       }
                                   },
                                   "input": {
                                       "attributes": {
                                           "name": "adUpn"
                                       },
                                       "type": "identityAttribute"
                                   }
                               }
                           }
                       },
                       "type": "upper"
                   }
               }
           },
           "attributes": {
               "cloudMaxSize": "100",
               "cloudMaxUniqueChecks": "25",
               "cloudRequired": "true"
           },
           "isRequired": false,
           "type": "string",
           "isMultiValued": false
       }```

Hi @chandramohan27,

In the patterns, try something like this :

"patterns": [
                       "$ebsUser",
                       "$ebsUser${uniqueCounter}"
            ]