Workflow not starting for scoped application

SanjenFibers
Tera Guru

Using "Studio" I created a scoped application for management of a table that extends task. Record producers are used to create/modify the table records, flows are used to connect processing of these records to other platform activities, and there is a dedicated workflow attached to the table records to control state transition and approvals. Things have moved along fine while I've been working with the scoped app selected in the application picker. 

While debugging problems with approval notifications,  I went back to the Global scope to  modify the conditions on some existing notifications to exclude them when processing approvals related to the new table's records.  This worked so I tried to run another test (this time in 'Global' not in the scoped app).  The the standard notification was omitted as expected, but the notifications defined in the application scope did not fire.

I got to wondering if having the application set from app picker allowed things to work. I set the scope back to the custom app, and then I impersonated an individual that is assigned itil roles in our system and normally works tickets.  The record producer was available to the user, script include calls worked, the new record was created, business rules fired and expected flows ran, but the workflow context was not created for the new record.  This means the data in the record was not initialized, so none of the down-stream processes had the correct data.  As the workflow did not run, the notifications did not fire either.

Is there something special you have to do to get the workflow context created for a scoped application? 

 

1 ACCEPTED SOLUTION

SanjenFibers
Tera Guru

As I was hoping, this turned out to be something very obvious.  I have been working on this app for quite a while, and forgot that the workflow had never been published.  As such, it was not available to the target audience.  After publishing the workflow everything worked as expected. 

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

Hi @SanjenFibers ,

Is the workflow context being created at all? Have you checked wf_context table to see if there is a context for the current record?

Open module named 'Active Contexts' and update the workflow version field with new Workflow version.

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

SanjenFibers
Tera Guru

Yes, I have checked the module All Contexts.  The workflow context is simply not created and the link I added to "show workflow" does not appear.  That link does not normally work (I've left fixing that for later), but it does normally show up when a context exists.

This morning I've created a record while logged in with my admin account with the custom app selected in the application picker. Everything works fine.  I then impersonated another ITIL user and created a new record and the workflow context was not created.  This does not appear to be related to any particular set of conditions that only occurred last night.

I thought the flows were working last night, but I  really cannot say that with any certainty as the conditions that kick off the flows rely on initialization that occurs in the workflow. 

 

SanjenFibers
Tera Guru

As I was hoping, this turned out to be something very obvious.  I have been working on this app for quite a while, and forgot that the workflow had never been published.  As such, it was not available to the target audience.  After publishing the workflow everything worked as expected.