Creating subtasks in Workflow with own workflows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 09:13 AM
Hi,
I have a RITM process that creates subtasks to collect documents (basically, eight different Task subtables for various documents, some subset of which are needed each time through). Simple enough. But, then I need to make sure the attached documents are reviewed. Seems simple enough: create a workflow with an Approval activity for each document type (they're all under the same base table. IE: one subtable under Task. Each individual document subtable is a subtable from that first subtable).
But, what is happening is that the document tasks are being created correctly (I used the Create Task activity), but there is no Workflow started with them.
So, several questions ensue. First, is there some work that needs to be added in the Task creation to get the Workflow to kick off? Second, is there an easy way to see if the Workflow is there (my current kludge involves doing the steps to get to that Approval activity and seeing if an approval record has been created)? Three, is there a better way to create the document tasks? Or to directly call out the Workflow (parallel flow launcher comes to mind, though appears to be a terrible choice when needing only one flow)?
One additional point of clarification: the Workflow was created to run for the base document task table. I also tried creating a copy of that for one of the subtables, with identical results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 10:12 AM
Experimenting a bit, did answer one of my own questions. To see if a Workflow exists for a task, went to /context_workflow.do, with base table name and sys_id as parameters. Confirmed that it did not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Forgot about this a while ago, but following up, in case it helps anyone else. What definitely worked was a business rule on the base document task table that manually created a workflow object, got the workflow from the name, and started that workflow.
var wf = new global.Workflow();
var wfId = wf.getWorkflowFromName ('workflow name');
var ctx = wf.startFlow(wfId, current, 'insert');
What might also work is setting the table's Variable Attribute of hasWorkflow, then defining a single workflow on that table. Didn't pursue that, as it definitely doesn't work for my use case, where I have a base table and subtables. But if it might work for you, go to the dictionary (sys_dictionary_list.do), and look for one (of type Collection) named after the table, and set the variable attribute hasWorkflow for it.