How to change Work Item Approval status on Deliver in RTC - clearcase

In our team, we try to implement Code Review using RTC.
Server is already configured to accept delivery of changes only when Work Item is approved.
The big issue with this approach is that once the WI is approved, it allows further multiple changesets being delivered without Reviewing them.
My question is: Can RTC be configured in such way that each delivery of ChangeSet changes the Approval Status of related Work Item to 'Pending'?
Or (worse case) delete whole approval from WI?

The big issue with this approach is that once the WI is approved, it allows further multiple changesets being delivered without Reviewing them.
One of the operation pre-conditions (the Source Control / Deliver Server one) does state:
Note: To prevent users from linking new change sets to work items that already have approvals, enable the Prevent Linking to Approved Work Items precondition.
So once approved, no more change sets should be linked to that WI. If the approval means the code has been reviewed, the WI can be delivered (knowing the number of change sets hasn't changed).
Farhan adds in the comments:
It can also be achieved by adding new approval cycle each time change-set submitted, So using this approach workItem will not be approved until all approvals gets approved.
You would need to develop extension for it, code in this article can help you to programmatically create/modify approvals: see "Creating, customizing, and deleting approval records programmatically with Rational Team Concert".

Related

How to Create Flows for these conditions?

Flow Task
Create below three User Lookup fields Account-
Assigned Attorney
Assigned Paralegal
Managing Attorney
When an event is created, automatically add each of the users in these specific “fields” on an account as an attendee to each event at the point the event is created;
Assigned Attorney
Assigned Paralegal
Managing Attorney
For all future events on an Account calendar, when an assignment in one of the three fields below changes, automatically update the attendees on the event, removing any removed attendees and adding any added attendees.
Assigned Attorney
Assigned Paralegal
Managing Attorney
Recently I learned flows in salesforce and i tried this problem but didn't find out that how to approach this.
Not sure how far you got with your flow, but I'll assume it was a triggered flow / autolaunched flow, and that you're aware of the eventrelation object that links invitees to events - see reference here (https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_eventattendee.htm).
So, you'd have a Flow triggered by event creation where the event is linked to an account (aka WhatId starts with '001'). This flow would retrieve the ids from the fields you described, build a list of eventrelation records and insert them.
You'd need another Flow triggered by account update where one or more of those fields change. You'll need to check each for a change and if changed, remove the old matching eventrelation record and create a new one to reflect the new invitee.
That should cover it. Give it a shot.

How to keep track of chat messages seen by user

I am building a simple Chat App using Firebase and Ionic. I am trying to keep track of number of messages that are unread for different groups that the user is member of (like WhatsApp).
I have the messages linked to $scope through $firebaseArray
$scope.messages = $firebaseArray(<ref to message path in firebase>);
$scope.messages is iterated over and shown in the view. When a new message arrives it automatically shows up in the group being viewed. I want to keep track of messages not viewed. I am not quite sure of the best way to keep track of which messages the user has seen. I see suggestions here to keep track of timestamp when a user last visited a group but am wondering if there is a better/simpler solution to this.
The things that come to mind that I need to do are -
Setup some sort of monitoring for all groups the user is member of not just the one being viewed by the user. If user is member of 50 groups I need to monitor all 50 of them individually (wonder what, if any, performance implications that has). Here I will need to setup a child_added monitoring for each of the groups the user is member of
Track timestamp for last time a user was in a group
As the user switches groups, change the $firebaseArray to monitor the new group and cancel the $firebaseArray setup for the previous. Change the child_added monitoring for the new group to the group being viewed previously
If the user moves to another part of the app where he is not looking at any group messages (perhaps in a setting section) then again be aware of that and monitor all groups - remove the firebeaseArray from the group last being viewed and add a child_added monitoring when user moves away
If the user goes to another application and pushes the Chat application in the background then I am a little unsure of what to do
How does the code determine that the group whose messages the user was looking at is no longer active and new messages coming in now need to be counted
I am assuming I need to monitor for the App Pause and Resume events to address that. Is there a better way?
Trying to keep my code simple but feels like monitoring for unread messages is a significant chunk of work. Thanks for any ideas or pointers to sample code or to simplify this.
-S

Keeping repository synced with multiple clients

I have a WPF application that uses entity framework. I am going to be implementing a repository pattern to make interactions with EF simple and more testable. Multiple clients can use this application and connect to the same database and do CRUD operations. I am trying to think of a way to synchronize clients repositories when one makes a change to the database. Could anyone give me some direction on how one would solve this type of issue, and some possible patterns that would be beneficial for this type of problem?
I would be very open to any information/books on how to keep clients synchronized, and even be alerted of things other clients are doing(The only thing I could think of was having a server process running that passes messages around). Thank you
The easiest way by far to keep every client UI up to date is just to simply refresh the data every so often. If it's really that important, you can set a DispatcherTimer to tick every minute when you can get the latest data that is being displayed.
Clearly, I'm not suggesting that you refresh an item that is being edited, but if you get the fresh data, you can certainly compare collections with what's being displayed currently. Rather than just replacing the old collection items with the new, you can be more user friendly and just add the new ones, remove the deleted ones and update the newer ones.
You could even detect whether an item being currently edited has been saved by another user since the current user opened it and alert them to the fact. So rather than concentrating on some system to track all data changes, you should put your effort into being able to detect changes between two sets of data and then seamlessly integrating it into the current UI state.
UPDATE >>>
There is absolutely no benefit from holding a complete set of data in your application (or repository). In fact, you may well find that it adds detrimental effects, due to the extra RAM requirements. If you are polling data every few minutes, then it will always be up to date anyway.
So rather than asking for all of the data all of the time, just ask for what the user wants to see (dependant on which view they are currently in) and update it every now and then. I do this by simply fetching the same data that the view requires when it is first opened. I wrote some methods that compare every property of every item with their older counterparts in the UI and switch old for new.
Think of the Equals method... You could do something like this:
public override bool Equals(Release otherRelease)
{
return base.Equals(otherRelease) && Title == otherRelease.Title &&
Artist.Equals(otherRelease.Artist) && Artists.Equals(otherRelease.Artists);
}
(Don't actually use the Equals method though, or you'll run into problems later). And then something like this:
if (!oldRelease.Equals(newRelease)) oldRelease.UpdatePropertyValues(newRelease);
And/Or this:
if (!oldReleases.Contains(newRelease) oldReleases.Add(newRelease);
I'm guessing that you get the picture now.

Lock a record from other users when editing by single user in CakePHP 2.4

I am implementing a CakePHP 2.4 app.
I have User and Article as Models.
I have no articles/view action; only articles/edit and articles/delete actions.
When any User accesses the articles/edit webpage regardless as a GET or POST, that particular Article is locked from editing/deleting by other Users.
The following is the crucial part I need advice on.
If a User stays on articles/edit/23 but there is no activity for 30 minutes,
-- OR --
When the User leaves articles/edit/23 page,
then the articles/23 is now available for edit/delete by other Users.
Off the top of my mind, i know that in articles table, i need a field called currently_locked_by field that holds the user_id of the User currently in control.
My problem is with detecting the session inactivity and knowing that the User has left the edit page.
I am defining session inactivity in the edit page as when the User does not type anything in any input elements or changes any dropdown selection or checks/uncheck any checkbox.
Suggestions?
You could create a lock table with a combination of the user, resource and lock time. (Regarding your spec's when to start the inactivity - I recommend going simpler to start: "when they person loads the page". Otherwise you are also writing javascript to write to your database at the end of every field change.)
Whenever a person goes to the edit page,
They check that table for the resource and lock time. If the record does not exist or the lock time has been exceeded it is safe for them to edit.
If they can edit, then they insert a record as needed (and delete any records with that resource.)
This should take care of the timeout requirement as long you make sure the person still has a lock (or another hasn't locked the record) when they try to save their changes.
One technique to handle the leaving of pages, is to put in a beforeFilter test that removes all locks for that person. The downsides
You still can't tell if the person leaves and goes to some external
site.
The beforeFilter does add overhead to every page view.
If your users run two or more tabs, then navigating other tabs will
release the lock.
You could also just have every outbound link on that page release the lock (like going to an interstitial page) and let any departures via closing the tab, using address bar, etc timeout. (It depends on how your users work.)

CakePHP afterSave Timing

I have a situation where, in a model's afterSave callback, I'm trying to access data from a distant association (it's a legacy data model with a very wonky association linkage). What I'm finding is that within the callback I can execute a find call on the model, but if I exit right then, the record is never inserted into the database. The lack of a record means that I can't execute a find on the related model using data that was just inserted into the current.
I haven't found any mention of when data is actually committed with respect to when the afterSave callback is engaged. I'm working with legacy code, but I see no indication that we're specifically engaging transactions, so I'm trying to figure out what my options might be.
Thanks.
UPDATE
The gist of the scenario is this: We're taking event registrations, but folks can be wait listed. A user can register (or be registered) for a given Date. After a registration is complete, I need to check the wait list for the existence of a record for the registering user (WaitList.user_id) on the date being registered for (WaitList.date_id). If such a record exists, it can be deleted because it's become an active registration.
The legacy schema puts me in a place where the registration isn't directly tied to a date so I can't get the Date.id easily. Instead, Registration->Registrant->Ticket->Date. Unintuitive, I know, but it is what it is for now. Even better (sarcasm included), we have a view named attendees that rolls all of this info up and from which I would be able to use the newly created Registration->id to return Attendee.date_id. Since the record doesn't exist, it's not available in the view.
Hopefully that provides a little more context.
What's the purpose of the find query inside of your afterSave?
Update
Is it at all possible to properly associate the records? Or are we talking about way too much refactoring for it to be worth it? You could move the check to the controller if it's not possible to modify the associations between the records.
Something like (in psuedo code)
if (save->isSuccessful) {
if (onWaitList) {
// delete record
}
}
It's not best practice, but it will get you around your issue.

Resources