Work object prefix becomes "C-" when created from Agent
We have a workflow whose pyWorkIDPrefix is "PR-" (stands for PurchaseRequest) and it works fine when created by user from portal screen. We have a batch requirement to create purchase request work objects based upon certain criteria. I have created an Agent, with mode of Advanced, and pattern of Periodic. It fires properly and is successful creating work objects, however there is one issue - prefix of work object is incorrect (C-). If I do Property-Set .pyWorkIDPrefix to be "PR-" in the activity then it works but this is unnecessary hard coding and I do not want to do that. I have this "PR-" prefix in the application rule but why is this symptom happening? Is it because the operator ID that is firing this Agent does not have our custom layer ruleset and therefore it is not referencing application? I also tried setting the access group in our layer for Agent but the result was the same. What is the best approach?