I need to access a some information at the beginning of the workflow, specifically I need to do a query on the fly in order to populate some dynamic form fields.
In order to do this I think there are two options.
The first is option is to instantiate the CommserveDBquery class and use the output, I was able to find the class definition but a few things are not clear. The following screenshots will hopefully make it clear. This a is screenshot of the class definition, the assumption being that the fields that needs to be populated are “CommCell” , and sql. This is the code I came up with to do it.
You can see that the things I don’t know how to define is “resultset” and “activitycontext”, this makes since typically within the workflow “activity” is contextual so executing an activity that is not connected to the workflow would need to be populated.
The second option is to have an activity defined with the fields pre-populated. Like this:
The issue in this instance is I have absolutely no idea how to execute this.
Best answer by Chris Sunderland
Here is some code that will allow you to execute a process block from script.
Not sure how good restartability will be with this but it will call the process block and pass whatever inputs you provide to it.
You would need to use interactive workflows, which would allow you to run db query activities and use the results to populate PopupInput activities. Once you are done with the data collection, then you would need to call EndUserSession before you begin the actual work of the workflow.
I’ve attached a small sample workflow to demonstrate this.
A couple of points:
On General tab of the Workflow Properties, you need to set Start interactive session to true
In the PopupInput activities, you go to Customize Inputs, and set the possible labels and values to the outputs of the db query activity.
I opened a ticket for the problem that dynamic input rules are not working with user interaction activities.
The rules do happen to work with the workflow inputs themselves, but that raises this question of being able to do a query *prior to* the workflow form itself loading.
Which is I why I phrased the question the way I did.
This way I can run a script to execute the query and populate the inputs of the workflow form.
It doesn’t necessarily have to be on loading of the form, in fact if there was a simple was of calling a process block from a script that would be awesome.
I would take that since it would not require an answer for every activity type.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.