- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2015 02:17 PM
Hello all:
I haven't quite wrapped my head around workflows, but is it possible to run a workflow when a record is updated? Keep in mind for this, I cannot use an order guide because the REQ (sc_request) record needs to be created from an e-mail inbound action. From there I have been able to auto create a RITM that is attached to it for a manager to fill out important onboarding data. This is an on-boarding process. Ultimately what I would like to accomplish happens in these steps:
1) regular user completes some fields on the "FIT" RITM they have. Data must be entered into the "Type of PC" field in order to generate a RITM for the SN_Service Desk group, and data must be entered in the Office/Cubicle field in order to generate a RITM for the SN_Facilities group.
2) If these fields are filled out and the person clicks the "Update" button, I would like it to automatically close this RITM, and then generate the RITMs for the two assignment groups listed above
3) The two RITMs would also be attached to the original REQ record in order to track it.
I have written a workflow that is set on the sc_req_item table:
The purpose of this workflow is to run when a RITM hits the "Closed Complete" stage and has the Item (cat_item) value of "FIT," I'd like two additional RITMs to be created - one for the Service Desk assignment group, and another for the Facilities group. Here is a look at the workflow:
The "Create Task" steps are set as such:
The "Create Facilities RITM" is set similarly, but with the Fulfillment group being "SN_Facilities"
It doesn't seem to work as I want it to, since the RITMs are never created.
Is this all possible from the workflow? What should I add or where should I add this in order to accomplish this? Any help on this would be awesome! Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2015 04:11 PM
Ken,
Try to Do something like:
1) Have a Business rule on 'sc_req_item' which will run when any of the two fields change and have the script as:
// pass the sys_id of the record in 'wf_workflow' table, not the wf_workflow_version table.
startWorkflow('<<sys_id>> of the Workflow');
function startWorkflow(id) {
var w = new Workflow();
var context = w.startFlow(id, current, current.operation(), getVars());
}
function getVars() {
var vars = {};
for (var n in current.variables)
vars[n] = current.variables[n];
return vars;
}
2) Now in you 'Create Task' activity in the Advance Section, have something like this also:
task.request = current.request.sys_id;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2015 03:07 PM
What is your starting condition (in the workflow's Properties)? I can't see it in the screenshot. It sounds like you need to have your start condition set to "State = Closed Complete". Or is this workflow you have created running as a sub-workflow off another one?
When you say the RITMs are not being created, is the workflow running at all? Is it going through the activities, but not creating the tasks, or is it just not executing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2015 03:16 PM
Thanks for the reply!
The start condition isn't able to be set it seems when I specify the table - sc_req_item. I noticed that when I don't specify the table, the conditions fields will appear. But I cannot go back and unselect a table in the properties, only when I create a new one.
This workflow is not running as a sub-workflow.
It appears the workflow is not executing at all, but that may be because I'm not sure exactly what actions would trigger it. I assumed that any update to the sc_req_item table would execute it. But is that accurate?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2015 03:35 PM
Try using a Wait for condition Activity before your If Activity. Set the condition for when you want the workflow to run, like State is Closed Complete.
Test it on a RITM. After the workflow should have run, click the Show workflows UI Action on the RITM and see if there are any workflows attached, and if there are, do the paths have a blue line along them where they should be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2015 03:51 PM
Ok I have done that, and the workflow I have created is not running. There are two workflows that run, so how can I get mine to at least fire?