Discussion

$None

Hi,
I have different work classes(Let us suppose 3 different flows).
I am using the same activity for 3 flows.

But I am having problem with pyWorkPage. Because pyWorkPage is different for all 3 flows.It is not same.

Can you please let me know can i use $None in Pages and Classes tab in activity instead of giving the work class.

Let me know naming convention is correct or not.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

July 9, 2009 - 11:59am

leninpega wrote: But I am having problem with pyWorkPage. Because pyWorkPage is different for all 3 flows.It is not same.

I'm sorry, but where precisely are you referencing "pyWorkPage"? From the flow? (or other rules?) And, more critically, from where in those rules?

Jon

July 9, 2009 - 12:08pm

I am referencing pyWorkPage in the activity and using that in same activity.Please note that I am reusing same activity for all the flows.

July 9, 2009 - 12:23pm

quote:


Originally posted by leninpega

I am referencing pyWorkPage in the activity and using that in same activity.Please note that I am reusing same activity for all the flows.

Ok. First off, if these are utilities, the pyWorkPage identifier is generally unnecessary. The primary page will be the work page. (This is one of the oldest pieces of advice I received-- it predates the PDN, so I am wondering if it is there.)

Separately you need to find the common ancestor for these classes-- if nothing else than to add the activity to that class. That common ancestor could be Work-, or it could be YourCo-Work-. If you need to declare pyWorkPage (or any other page name), you would use that common ancestor class.

Jon

July 9, 2009 - 12:35pm

Jon,
That is not an utility and that is a Activity.
where we are calling the same activity from 3 different other activities.

In First scenario, work class is like abc-work-AVOF
In Second scenario, work class is like abc-work-Update
In third scenario , work class is like abc-work-CustProfile

If I referenced the first work class in Common Activity, it is working fine for first scenario.

And not working for other scenarios and it is setting the messages(What Ever in Activity) for first pyWorkPage in other scenarios too..

I can use the common work class like abc-work ????

Please let me know what is the use of &None giving in class field under Pages & classes

July 9, 2009 - 1:47pm

leninpega wrote: That is not an utility and that is a Activity.
where we are calling the same activity from 3 different other activities.

When I refer to "utility" I am using PRPC's definition -- it is called by a flow (directly or through another activity), and thus has the primary page as the work page. Even some of our activities called from buttons, we set the primary page via the URL. So in most cases you do not need to reference pyWorkPage directly.

For your example, it appears like abc-work is the common ancestor.

re: Please let me know what is the use of $None giving in class field under Pages & classes.

I don't have a good answer off the top of my head. I have seen it, it has been used, I believe it's the functional equivalent of @baseclass, but, generally, I don't use it. I am searching PDN and our internal knowledgebase, and nothing comes up immediately; in the meanwhile, just use the closest ancestor.

Jon

August 19, 2009 - 9:52am

you can use $ANY in pages and classes tab for pyWorkPage else the second method is refer primary in the step page , since it get executed from flow it will take pyWorkPage as its primary page .

I will recommend the second method as best practice

May 12, 2016 - 5:05am

what is the difference between $any and $none ?

May 23, 2016 - 7:29am
Response to santhoshram

In the earlier versions, application used to have several activities that use $ANY in its Pages & Classes tab. If the class is not determined/finalised at the time of writing an activity, developers used it as an easy way out. 

Once you upgrade you might come across below or similar errors. 'Invalid expression or reference: When used with a "For Each Embedded Page" option, the step page should reference a list or group property.'  Similar results might be there for the use of $None. Also $None references from 5.5 are defaulted to blank in 7.1.8 more specifically. These issues need to be fixed manually after identifying it. There is no OOTB way to fix these issues and there is no generic solution for this. Pega restricts the use of $Any/$Class/$NONE.

As per my knowledge, using $ANY have impact in terms of maintenance and testing costs for the customer, because the engine is not able to do proper validations. When the engine sees a class of "$ANY" it doesn't attempt to validate that reference because it doesn't know the class of the rule, so it cannot validate whether or not it exists.

It is not an exact answer to your question but might be helpful.

Thanking you