I have a workflow with a string field that I want to offer as a dropdown of results from a SQL database. I've created an action to query the database that is passed a SQL:Database value. The action script is below:
// DO query on MGMTDB
var results = new Array();
var SingleResult;
var query = "SELECT TemplateOS,TemplateVersion FROM TableName";
var QueryResults = MGMTDB.readCustomQuery(query);
for each (SingleResult in QueryResults)
{
var template = SingleResult.getProperty("TemplateOS") + " " + SingleResult.getProperty("TemplateVersion");
//System.debug("getTemplateNames:: " + template);
results.push(template);
}
return results;
However, as soon as I add the action to a presentation property, the workflow spends an eternity "processing presentation". The action itself works quickly enough. I added it to a test workflow as part of its schema and I get the desired array of strings back instantly. It's only when it's being used for presentation that it's giving me a problem.
Anyone have any ideas what's going on?
Is this field then used to calculate other fields ? The issue may be that when first loading your presentation may try to calculate fields using null inputs. One way to avoid the errors is to test for null input parameters in each action and return null.
Hi Michael,
did you ever tried your action within a workflow to see the result? Is it running correctly and as expected? From my side this sounds like you'r having a loop within your action or it does take really long :smileysilly:
Cheers Chris
Thanks Chris.
Yes, I tried it in a workflow and it completes very quickly. The presentation does complete if I leave it long enough.
Interestingly, I noticed that there were some errors being logged in vCO at around the same time. I’m going to dig into those and see if they’re connected.
Michael
There should not be a big difference in action execution time depending on whether it is executed directly in a workflow or as part of a presentation.
Could you check if there is other stuff in the presentation which could potentially take a long time to evaluate (other actions, etc.)? If possible, could you send a copy of your workflow/action and the log files, plus some info about your environment, like vCO version, plug-in version, deployment type (appliance/standalone), database version, etc.
Is this field then used to calculate other fields ? The issue may be that when first loading your presentation may try to calculate fields using null inputs. One way to avoid the errors is to test for null input parameters in each action and return null.
There are a couple of vCAC plugin related fields that could be causing issues - I'm seeing some related errors in the logs. I'm going to re-write the workflow to separate those out and see what happens.
Many thanks.
Thanks, I did see another thread where this was an issue. I actually hadn't got as far as doing that bit yet. Looks like the culprit could be some interaction with vCAC through the plugin. I'm going to re-work the workflow a bit and see if I can rule those bits out.
Cheers.