- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2017 01:09 AM
I added two states draft and work in progress as the process given in Add a state to the change state model
in my case the first step is draft and second state will be work in progress after that there are other states
i have to do in a way that from draft the state will only be updated to work in progress. After it comes to work in progress then it may go to another state for . this is emergency change request type
But i cannot understand how to edit the script include ChangeRequestStateModel_emergency.
Need help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2017 12:59 AM
Hi Suprakash,
'Review' is a OOB Change request state, so you do not have to define 'canMove' or 'moving' function separately for review. In your case the code will below:
work_in_progress: {
nextState: [ "review" ],
review: {
moving: function() {
return this.toReview_moving();
},
canMove: function() {
return this.toReview_canMove();
}
},
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2017 09:06 PM
Thanks Amlan for sharing,
But it is not working. Even I have Made a copy of Readonly script include as well and modified the business rule accordingly. But it is not working.
Thanks
Saptashwa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2017 09:17 PM
Hi Saptashwa,
Could you please elaborate your issue and the customization you have done?
Did you follow the all 3 steps which II have mentioned in my first response? As far as I know to add any new State choice you do not have to create/modify any Business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2017 09:36 PM
I have created as per your guidence. But actually the OOTB business rule is calling the STATEHANDLER script include. The stateHandler script Include is again calling the STATEHANDLERSNC script include. Now in the STATEHANDLERSNC OOTB states are there.
Also in the business Rule the function used is defined in STATEHANDLERSNC.
So I just copied the STATEHANDLERSNC and changed the name to STATEHANDLERSNC_custom and STATEHANDLER to STATEHANDLER_custom. Then called it from the business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2017 10:06 PM
Hi Saptashwa,
You are supposed to modify the ChangeRequestStateHandler Script include in order incorporate the newly defined the state choices. Please find the sample code below. In this code I am incorporating new Change state as 'Resolved'.
If you are talking about 'State model - Can change state?', the OOB Business rule, I would suggest to keep that as it is
var ChangeRequestStateHandler = Class.create();
// All references to statehandler constants should be through this class ChangeRequestStateHandler
ChangeRequestStateHandler.DRAFT = ChangeRequestStateHandlerSNC.DRAFT;
ChangeRequestStateHandler.ASSESS = ChangeRequestStateHandlerSNC.ASSESS;
ChangeRequestStateHandler.AUTHORIZE = ChangeRequestStateHandlerSNC.AUTHORIZE;
ChangeRequestStateHandler.SCHEDULED = ChangeRequestStateHandlerSNC.SCHEDULED;
ChangeRequestStateHandler.IMPLEMENT = ChangeRequestStateHandlerSNC.IMPLEMENT;
ChangeRequestStateHandler.REVIEW = ChangeRequestStateHandlerSNC.REVIEW;
ChangeRequestStateHandler.CLOSED = ChangeRequestStateHandlerSNC.CLOSED;
ChangeRequestStateHandler.CANCELED = ChangeRequestStateHandlerSNC.CANCELED;
ChangeRequestStateHandler.RESOLVE = "resolve"; //You Need to add this new line
ChangeRequestStateHandler.prototype = Object.extendsObject(ChangeRequestStateHandlerSNC, {
initialize: function(changeRequestGr) {
ChangeRequestStateHandlerSNC.prototype.initialize.call(this, changeRequestGr);
this.STATE_NAMES["6"] = ChangeRequestStateHandler.RESOLVE; //You need to add this new line also. I have given 'Resolved' State value '6'
},
type: "ChangeRequestStateHandler"
});
Once, you are done with modifying the OOB ChangeRequestStateHandler Script include, you can modify the individual Script includes for different types (example:ChangeRequestStateModel_normal) as I have mentioned in my earlier response to Suprakash.
I hope, this is enough for you to understand and carry on modifying the script includes as per your requirement. Also suggest you to go through each links (given in every steps) in my earlier response.
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2017 10:24 PM
Hi Amlan,
I have done the same. But I think, there might be some mistakes occurred by me. So I am trying again. I will let you know further updates. Please Co-operate.
Thaks,
Saptashwa