CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Case Type xml configuration - Activity Type and timeline questions
Pages: [1]

Author Topic: Case Type xml configuration - Activity Type and timeline questions  (Read 2168 times)

NatHolder

  • Guest
Case Type xml configuration - Activity Type and timeline questions
March 06, 2009, 12:22:30 pm
Hello everyone,

I’m new to drupal, CiviCRM and CiviCase and have been trying it out.  Here are some questions and issues that I’ve encountered in setting up CiviCase for my agency New Avenues for Youth.  Thanks for any feedback!  I've attached my CaseType xml file for reference.  My questions don't seem to be covered in the CiviCase Configuration wiki documentation (http://wiki.civicrm.org/confluence/display/CRMUPCOMING/CiviCase+Configuration#CiviCaseConfiguration-1.CaseConfigurationFiles)

1)   What does the <status> refer to in the Case Type xml configuration file, as in
     
Code: [Select]
<ActivityTypes>
        <ActivityType>
          <name>Open Case</name>
          <status>Closed</status>
        </ActivityType>
It seems like if it refers to the activity status and when it is “Closed” then the status is set to “Completed” when the activity is created, else it is set to “Scheduled”. 

2)   I would like to be able to change the Case Status automatically after completion of an activity, i.e. when the client completes a Homeless Youth Services Screening, I want their status to be automatically set to “Screened” (I’ve changed the case status types to be Inactive, Screened, Assessed, Engaged, Exited, Closed to conform to our process flow).  What's the best way to achieve this?

3)   What does the <reference_select> refer to, as in
Code: [Select]
      <ActivityTypes><ActivityType>
          <name>Engagement Exit Follow Up</name>
          <reference_activity>Engagement Exit</reference_activity>
          <reference_offset>180</reference_offset>
          <reference_select>newest</reference_select>
        </ActivityType>

4)   I’d like activity triggers be able to be scheduled after completion (vs after scheduled) of a reference activity.  For the moment I'll look at implementing a hook, but wondering if this might be wanted for core functionality.

5)   I have an activity whose reference_activity isn’t scheduled automatically after Open Case, but the activity type is still being scheduled after Open Case – I want the activity type to be scheduled ONLY after the reference activity has been scheduled.  For example, activity “Case Management Initial Assessment” is scheduled after Open Case instead of after “Homeless Youth Services Screening” is scheduled.  I wonder if the reference_offset tag is just not functioning yet.
Code: [Select]
        <ActivityType>
          <name>Case Management Initial Assessment</name>
          <reference_activity>Homeless Youth Services Screening</reference_activity>
          <reference_offset>7</reference_offset>
          <reference_select>newest</reference_select>
        </ActivityType>

Thanks again for your help.  CiviCase and CiviCRM are looking promising!

~Nat

Nat Holder
Lead Programmer, New Avenues for Youth


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Case Type xml configuration - Activity Type and timeline questions
March 06, 2009, 05:22:18 pm
Hi Nat - excellent set of questions. Answers inline. Would be appreciated if you can add / clarify things on the wiki as needed based on info below.

Quote from: Nat Holder on March 06, 2009, 12:22:30 pm
1)   What does the <status> refer to in the Case Type xml configuration file, as in
     
Code: [Select]
<ActivityTypes>
        <ActivityType>
          <name>Open Case</name>
          <status>Closed</status>
        </ActivityType>
It seems like if it refers to the activity status and when it is “Closed” then the status is set to “Completed” when the activity is created, else it is set to “Scheduled”. 

Yes. Open Case is a special case (for now) since it's not handled by the "normal" activity class - but by an instance of the Case class. Status tells the code to set activity status property by looking up that string in option_value.name in the activity_status option group.

Quote
2)   I would like to be able to change the Case Status automatically after completion of an activity, i.e. when the client completes a Homeless Youth Services Screening, I want their status to be automatically set to “Screened” (I’ve changed the case status types to be Inactive, Screened, Assessed, Engaged, Exited, Closed to conform to our process flow).  What's the best way to achieve this?

For now I think the only way to do this is with the "post" hook. This might be a good feature to add in the future (configured via another element in the ActivityType properties).

Quote
3)   What does the <reference_select> refer to, as in
Code: [Select]
      <ActivityTypes><ActivityType>
          <name>Engagement Exit Follow Up</name>
          <reference_activity>Engagement Exit</reference_activity>
          <reference_offset>180</reference_offset>
          <reference_select>newest</reference_select>
        </ActivityType>

It tells the xmlProcessor class to check for the "newest" instance of the reference activity. (The other valid value is "oldest".) Caveat that this is one of the properties that I don't think got much "exercise" in this dev / QA cycle since all use cases for Physician Health were to use "newest".

Quote
4)   I’d like activity triggers be able to be scheduled after completion (vs after scheduled) of a reference activity.  For the moment I'll look at implementing a hook, but wondering if this might be wanted for core functionality.

Yes. This has come up and would definitely be useful for core. A hook makes sense for now. Please post your hook code back for others to check out. You should also check out the very rough "blue sky" Phase 2 Candidates list that's being "grown" on the wiki: [http://wiki.civicrm.org/confluence/display/CRM/CiviCase+-+Phase+2+Candidates]

Quote
5)   I have an activity whose reference_activity isn’t scheduled automatically after Open Case, but the activity type is still being scheduled after Open Case – I want the activity type to be scheduled ONLY after the reference activity has been scheduled.  For example, activity “Case Management Initial Assessment” is scheduled after Open Case instead of after “Homeless Youth Services Screening” is scheduled.  I wonder if the reference_offset tag is just not functioning yet.
Code: [Select]
        <ActivityType>
          <name>Case Management Initial Assessment</name>
          <reference_activity>Homeless Youth Services Screening</reference_activity>
          <reference_offset>7</reference_offset>
          <reference_select>newest</reference_select>
        </ActivityType>

Hmm - I think you get that the timeline activities are inserted "in batch" (in Case create and / or on "Add Timeline"), so no scheduling happens based on changes to another activity. If what you're saying is that when the case is created - the "Case Management Initial Assessment" is being scheduled 7 days after "Open Case" instead of 7 days after "Homeless Youth Services Screening" - this is a bug. If so - please post a bug report to the issue tracker and we'll try to fix before 2.2 stable.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviCase (Moderator: Dave Greenberg) »
  • Case Type xml configuration - Activity Type and timeline questions

This forum was archived on 2017-11-26.