How is your experience with the OutSystems Community?
9
Views
2
Comments
Case_GetActivities doesn't fetch human activities that are under parent processes
Question

Hi Forums,

Case_GetActivities successfully pulls the assigned to for the human activities that I am assigned - but, only when the human activity is in the top most level of the process.

Case_GetActivities is not pulling any human activities that are being waited upon within the "Execute Process" (therefore deeper than level 1).

Does anyone have a way to pull them? An Advanced query won't work since Advanced queries don't have access to the BPM tables.

Thanks,

Frank

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

In Case Management framework, Case_GetActivities only returns case activities, not every BPT Human Activity that happens somewhere inside your processes.

That distinction is the reason you only see “top level” items and nothing from inside your “Execute Process” / subprocess levels:

  • Activities that are explicitly modeled as Case Activities (using the CMf patterns) are exposed to Case_GetActivities.
  • “Plain” BPT Human Activities that live inside your business process (main process, subprocess, “Execute Process” patterns, etc.) are not exposed as CMf activities and therefore will not appear in Case_GetActivities.

This is by design; BPT runtime / BPM tables are not meant to be queried directly from application code, which is also why an Advanced Query cannot reach them.

How to make deeper-level work items visible

To list work that is happening “deeper” in your process, you have to surface it as case activities. Typical approaches are:

  1. Create a dedicated Case Activity representing the work you’re doing inside the subprocess, and:

    • Start that Case Activity when your “Execute Process” starts the corresponding BPT Human Activity.
    • Assign the Case Activity to the same user/group you assign the BPT Human Activity to.
    • Complete/close the Case Activity when the BPT Human Activity finishes.

    Once it’s a proper Case Activity, Case_GetActivities will return it (and you can filter/assign using ActivitySearchCriteria as in the example for user and group assignment). Really mine with Case_GetActivities

  2. Use subcases/subflows instead of deep subprocesses when you want the case engine to understand the structure.
    In CMf, a common pattern is:

    • Main case flow is “waiting” on a subcase/subflow.
    • The subcase contains its own Case Activities.
    • Those activities naturally appear in Case_GetActivities, while the parent case waits. Case Assign Process, after subprocess

In both patterns, the key idea is: if you want to see something in Case_GetActivities, model it as a case-level activity or subcase, not just as a BPT Human Activity buried inside a process.

Why you can’t just query BPT directly

As you mentioned, Advanced Queries can’t hit BPT meta-model tables; those are only accessible via:

  • Built‑in BPT meta‑model aggregates (when you expose process entities), and
  • BPT APIs (e.g., Human Activity Assign To User), which are intended for programmatic control of processes, not for building taskboxes/UI. How To Use APIs to Programmatically Control a Process

So, for building your Taskbox in CMf, the supported way is to surface everything you need as Case Activities and then rely on Case_GetActivities plus its search criteria to retrieve those.


Bottom line: there isn’t a configuration or parameter of Case_GetActivities that will suddenly expose Human Activities hidden inside “Execute Process” levels. You’ll need to refactor so that the work you care about is represented as CMf Case Activities (or subcases) that mirror the inner process activities.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
UserImage.jpg
Frank Guarino

How do I start the case activity inside Execute Process, I'm assuming a server action that runs Case_UpdateStatus?

Although helpful, I've worked hard to find out that it doesn't work with subprocesses. What is the help if I just get verbose explanation of my situation that I am aware of? I guess this was helpful, and I'll take it from here I guess


Yep, I don't see any changes once adding Case_UpdateStatus. I am not sure how to 'Create one'?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.