• Larry Wasser
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 9
    Replies
Simple SOQL query on CollaborationGroup fails when executed within a platform event trigger.

The query is successful within an object trigger or through an @invocableMethod.

Am I missing something? 
Does the autoproc user not have permissions on the CollaborationGroup object?

Here is the SOQL query:
List<CollaborationGroup> allGroups = [SELECT Id, Name FROM CollaborationGroup];

17:20:08.0 (19515769)|VARIABLE_SCOPE_BEGIN|[21]|event|CORE_Automation_Started_Event__e|true|false
17:20:08.0 (19612928)|VARIABLE_ASSIGNMENT|[21]|event|{"Program_Instance_Id__c":"a0919000003nNH5AAM","CreatedById":"0050B0000088oW9QAI","ReplayId":"156295","Role__c":"Active Learner","CreatedDate":"2020-09-09T21:20:07.000Z","Id":"e00xx0000000eetAAA","Action__c":"Add"}|0x4a46a6e1
17:20:08.0 (19626683)|STATEMENT_EXECUTE|[21]
17:20:08.0 (19659009)|HEAP_ALLOCATE|[23]|Bytes:3
17:20:08.0 (19695513)|STATEMENT_EXECUTE|[23]
17:20:08.0 (19698608)|STATEMENT_EXECUTE|[25]
17:20:08.0 (19702531)|HEAP_ALLOCATE|[25]|Bytes:73
17:20:08.0 (19715368)|SYSTEM_METHOD_ENTRY|[25]|System.debug(ANY)
17:20:08.0 (19734053)|USER_DEBUG|[25]|DEBUG|Entered CoreAutoAddStartEventTriggerHandler -- Add Automation Start Event
17:20:08.0 (19746165)|SYSTEM_METHOD_EXIT|[25]|System.debug(ANY)
17:20:08.0 (19751195)|STATEMENT_EXECUTE|[35]
17:20:08.0 (19755079)|HEAP_ALLOCATE|[35]|Bytes:39
17:20:08.0 (19781887)|HEAP_ALLOCATE|[35]|Bytes:4
17:20:08.0 (20161802)|SOQL_EXECUTE_BEGIN|[35]|Aggregations:0|SELECT Id, Name FROM CollaborationGroup
17:20:08.0 (20202930)|LIMIT_USAGE|[35]|SOQL|1|100
17:20:08.0 (20221448)|LIMIT_USAGE|[35]|AGGS|0|300
17:20:08.0 (34398664)|SOQL_EXECUTE_EXPLAIN|[35]|TableScan on CollaborationGroup : [], cardinality: 9, sobjectCardinality: 9, relativeCost 2.617
17:20:08.0 (34422629)|SOQL_EXECUTE_END|[35]|Rows:0
17:20:08.0 (34447997)|LIMIT_USAGE|[35]|SOQL_ROWS|0|50000

Thanks,
Larry 
Simple SOQL Query fails to yield results in live Apex code, but succeeds in Developer Console Execute Anonymous Window and in Query Editor Tab.

public void importProgramCollaborationGroupTable(){
   List<CollaborationGroup> allCollabGroups = [SELECT Id, Name FROM CollaborationGroup];
}
After repeatedly running an Autolaunched Flow, the Flow reaches exactly the same Pause node (after several prior EVENT/PAUSE/RESUME sequences) and never executes anything further.

Launch Autolaunch Flow (CORE Automation - CAU Routing) via Debug interface.
Flow proceeds through all prior sequences of:
- Create Platform Event (consumed by Process Builder, which publishes response Platform Event)
- Wait for response Platform Event
- Resume Flow Execution

Reaches next Create Platform Event, which receives an EventId
Continues to the next Flow node which is a Pause node
Pause node NEVER receives an Id (0Fo19.....) associated with the FLOW_WAIT_WAITING_DETAIL as all prior Pause nodes had received.

This is issue is reproducible with identical behavior.

No Errors are found in the logs
No Errors are Posted to Chatter
No Errors are sent via Email
Flow remains Paused in the Paused Flow Interviews, but is paused at the Pause element immediately prior to the Pause element at which the issue occurs.

Image of color-coded Flow Transaction Log FilesScreenshot of Flow Builder
Simple SOQL Query fails to yield results in live Apex code, but succeeds in Developer Console Execute Anonymous Window and in Query Editor Tab.

public void importProgramCollaborationGroupTable(){
   List<CollaborationGroup> allCollabGroups = [SELECT Id, Name FROM CollaborationGroup];
}
After repeatedly running an Autolaunched Flow, the Flow reaches exactly the same Pause node (after several prior EVENT/PAUSE/RESUME sequences) and never executes anything further.

Launch Autolaunch Flow (CORE Automation - CAU Routing) via Debug interface.
Flow proceeds through all prior sequences of:
- Create Platform Event (consumed by Process Builder, which publishes response Platform Event)
- Wait for response Platform Event
- Resume Flow Execution

Reaches next Create Platform Event, which receives an EventId
Continues to the next Flow node which is a Pause node
Pause node NEVER receives an Id (0Fo19.....) associated with the FLOW_WAIT_WAITING_DETAIL as all prior Pause nodes had received.

This is issue is reproducible with identical behavior.

No Errors are found in the logs
No Errors are Posted to Chatter
No Errors are sent via Email
Flow remains Paused in the Paused Flow Interviews, but is paused at the Pause element immediately prior to the Pause element at which the issue occurs.

Image of color-coded Flow Transaction Log FilesScreenshot of Flow Builder