Answers.Body: <p>End date alone does not determine if the relationship is 'active' or not. It will remain active until the scheduled job kicks in and makes it inactive. Examples include inherited memberships (membership by relationship). If you look in the advanced search you can see a radio option for active/inactive relationships. Its important to note anything in Civi that is using relationships to work out if it should carry out the action will most likely look for active relationships.<a href="https://i.sstatic.net/M1aB5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M1aB5.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T19:09:03.137Z
Answers.Text: Ok thanks we're getting there but I'm still not clear though why that type of search can't just look directly at the end date instead of needing another field and a cron job. Why can't end date alone determine if it's active or not? Farther down that page is `Active Period`, which is more flexible and covers the same ground without needing the extra redundant field and cron. Inherited memberships I don't know how they're currently implemented but why wouldn't they also be able to just look directly at end date?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T17:46:45.897Z
Answers.Text: I'm not disagreeing with your rationale, simply highlighting user cases. For example, its not always possible to know the dates i.e. I know someone used to work somewhere but I don't know when hey left etc. Therefore relationships cant always be attributed time elements.
Answers.UserDisplayName: Parvez Saleh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T19:02:39.820Z
Answers.Text: Ok thanks I'm willing to mark it answered just still not completely convinced :)
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T18:48:13.540Z
Answers.LastActivityDate: 2020-08-18T18:48:13.540Z
Answers.UserDisplayName: Parvez Saleh
Answers.Body: <p>(apologies if i am missing some deeper levels to this question)</p>
  <p>if a Relationships passes its End Date then the job sets it to be not is_active</p>
  <p>is_active is a setting you can use to disable a Relationship that may not have an End Date</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T00:18:52.827Z
Answers.Text: `is_active is a setting you can use to disable a Relationship that may not have an End Date` - what does that mean in real life?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T04:54:30.917Z
Answers.Text: I create a relationship. I do not know the end date for it. at some point i want to 'end' it, but i don't bother entering an 'end date' I just set the relationship to disabled. By contrast, I create a relationship that ends on Dec 31, so on Dec 31 i need a job to come along and change the Relationship from Active to Disabled
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T12:27:58.417Z
Answers.Text: I'm still not getting it. Is there a real world example of the first one? Why not just enter "today"? And for the second one why do you need the job? What does is_active=0 add that looking at the end date doesn't?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T14:17:21.013Z
Answers.Text: Yes, lets say there is an election in your local area and that election means the person who is voted will hold the position for 2 years. So you would setup the relationship for two years in advance (ending say 31-Dec-2022). On the 1st of Jan 2023 the relationship will still show active unless you have the scheduled job which works out if relationships have ended and therefore makes them inactive. Hope that helps!
Answers.UserDisplayName: Parvez Saleh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T15:54:29.373Z
Answers.Text: Hmm still not getting it. It has an end date - where is it showing as still active when you look on Jan 1 2023?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T14:41:59.080Z
Answers.Text: Pretty much everywhere! If you look on a contact record then it will show as active relationships, because, to the best of my knowledge, it will not check dates etc. It will simply look at the flag to determine if it thinks the relationship ship is active or not. The other scenario is when you don't have dates - for example I know someone worked at an organisation but I'm not sure when that employment started/ended. In this case I would record without dates and mark as inactive. Hopefully we are much closer to the finish line!
Answers.UserDisplayName: Parvez Saleh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T19:04:59.890Z
Answers.Text: The contact tab looks at both end date and is_active. If is_active were used much then it would be required to turn this job on for civi to function, but it's off by default and barely described in the docs.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-19T20:24:59.403Z
Answers.Text: An example. We use the Permissioned Relationship extension which confers ACL access based on whether a relationship 'is active' or not.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T00:13:35.603Z
Answers.LastActivityDate: 2020-08-18T00:13:35.603Z
Answers.UserDisplayName: petednz - fuzion
Body: <p><a href="https://forum.civicrm.org/index.php?topic=26380.0.html" rel="nofollow noreferrer">This forum link</a> where it was born seems to suggest that it's needed as a replacement for hooks or to be able to filter them in drupal views. But it seems you can make a view that filters based on end dates in the past, and there are hooks for relationships (maybe there weren't at the time of the original post).</p>
  <p>An alternate way of asking this question is &quot;what does is_active mean for relationships&quot;? Is it just a stand-in instead of using effective-dating queries such as are common in PeopleSoft or HR systems (which have broader use, e.g. list all the people who were active employees in 2019)? Is it just a redundant data field that means &quot;end date in the past&quot;?</p>
  <p>Besides trying to understand whether it's redundant and maybe a bit fragile, one reason I'm asking is that anyone who's using this scheduled job would be dependent on the fact that civi ends relationships when it does, and so a change to that would affect this. So another way of asking this question is &quot;Is anybody using this scheduled job and can describe your use case a little bit?&quot;</p>
  
Tags: <relationships>
Title: What is the purpose of the Disable Expired Relationships scheduled job?
ThreadText: # What is the purpose of the Disable Expired Relationships scheduled job?
  
  (Asked by: username_0 on 2020-08-18)
  
  [This forum link](https://forum.civicrm.org/index.php?topic=26380.0.html) where it was born seems to suggest that it's needed as a replacement for hooks or to be able to filter them in drupal views. But it seems you can make a view that filters based on end dates in the past, and there are hooks for relationships (maybe there weren't at the time of the original post).
  
  An alternate way of asking this question is "what does is\_active mean for relationships"? Is it just a stand-in instead of using effective-dating queries such as are common in PeopleSoft or HR systems (which have broader use, e.g. list all the people who were active employees in 2019)? Is it just a redundant data field that means "end date in the past"?
  
  Besides trying to understand whether it's redundant and maybe a bit fragile, one reason I'm asking is that anyone who's using this scheduled job would be dependent on the fact that civi ends relationships when it does, and so a change to that would affect this. So another way of asking this question is "Is anybody using this scheduled job and can describe your use case a little bit?"
  
  **Tags:** relationships
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-08-18. Score: 1 | Accepted answer
  
  End date alone does not determine if the relationship is 'active' or not. It will remain active until the scheduled job kicks in and makes it inactive. Examples include inherited memberships (membership by relationship). If you look in the advanced search you can see a radio option for active/inactive relationships. Its important to note anything in Civi that is using relationships to work out if it should carry out the action will most likely look for active relationships.[![enter image description here](https://i.sstatic.net/M1aB5.png)](https://i.sstatic.net/M1aB5.png)
  
  > **Comments:**
  > **username_0**: Ok thanks we're getting there but I'm still not clear though why that type of search can't just look directly at the end date instead of needing another field and a cron job. Why can't end date alone determine if it's active or not? Farther down that page is `Active Period`, which is more flexible and covers the same ground without needing the extra redundant field and cron. Inherited memberships I don't know how they're currently implemented but why wouldn't they also be able to just look directly at end date?  
  > **username_1**: I'm not disagreeing with your rationale, simply highlighting user cases. For example, its not always possible to know the dates i.e. I know someone used to work somewhere but I don't know when hey left etc. Therefore relationships cant always be attributed time elements.  
  > **username_0**: Ok thanks I'm willing to mark it answered just still not completely convinced :)  
  
  ---
  
  ### Answer by username_2 on 2020-08-18. Score: 0
  
  (apologies if i am missing some deeper levels to this question)
  
  if a Relationships passes its End Date then the job sets it to be not is\_active
  
  is\_active is a setting you can use to disable a Relationship that may not have an End Date
  
  > **Comments:**
  > **username_0**: `is_active is a setting you can use to disable a Relationship that may not have an End Date` - what does that mean in real life?  
  > **username_2**: I create a relationship. I do not know the end date for it. at some point i want to 'end' it, but i don't bother entering an 'end date' I just set the relationship to disabled. By contrast, I create a relationship that ends on Dec 31, so on Dec 31 i need a job to come along and change the Relationship from Active to Disabled  
  > **username_0**: I'm still not getting it. Is there a real world example of the first one? Why not just enter "today"? And for the second one why do you need the job? What does is_active=0 add that looking at the end date doesn't?  
  > **username_1**: Yes, lets say there is an election in your local area and that election means the person who is voted will hold the position for 2 years. So you would setup the relationship for two years in advance (ending say 31-Dec-2022). On the 1st of Jan 2023 the relationship will still show active unless you have the scheduled job which works out if relationships have ended and therefore makes them inactive. Hope that helps!  
  > **username_0**: Hmm still not getting it. It has an end date - where is it showing as still active when you look on Jan 1 2023?  
  > **username_1**: Pretty much everywhere! If you look on a contact record then it will show as active relationships, because, to the best of my knowledge, it will not check dates etc. It will simply look at the flag to determine if it thinks the relationship ship is active or not. The other scenario is when you don't have dates - for example I know someone worked at an organisation but I'm not sure when that employment started/ended. In this case I would record without dates and mark as inactive. Hopefully we are much closer to the finish line!  
  > **username_0**: The contact tab looks at both end date and is_active. If is_active were used much then it would be required to turn this job on for civi to function, but it's off by default and barely described in the docs.  
  > **username_2**: An example. We use the Permissioned Relationship extension which confers ACL access based on whether a relationship 'is active' or not.  
  
  ---
  
  