Hi All,
I have a complicated workflow, which starts with an external signal. The Workflow has multiple end points and Jumps.
We need to determine, if any activity is running when the External Signal receives a call, if already aby activity within the workflow is already running, then we need to wait, till all the activities and completed and process the record.
Using isRunning, as there are multiple end points, multiple combinations to reset the variable exist, which is throwing of the purpose of that. Is there any other way to determine the running of tasks for this purpose
Regards,
DG
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @dganguly ,
you can take a look at the field @processDate that will tell you the last processed time
Also if you have field on workflow table called process @processId which only has number greater than zero if the worklfow is actually running.
workflow running (idle) with external signal
Worklfow actually running
Visually you can see if worklfow is running by seeing cog above the activity currently being processed.
Marcel
Hello @dganguly ,
you can take a look at the field @processDate that will tell you the last processed time
Also if you have field on workflow table called process @processId which only has number greater than zero if the worklfow is actually running.
workflow running (idle) with external signal
Worklfow actually running
Visually you can see if worklfow is running by seeing cog above the activity currently being processed.
Marcel
Views
Replies
Total Likes
Hello @dganguly
workflow table im running version 9359 application server. You might not have it perhaps you can try to find field that does similar
Marcel Szimonisz
MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/
I could find the field. Just one follow up question.
In a workflow, let's say in a JS Activity can we find which task is currently being executed.
Use Case:
In a workflow, I have 2 branches. the first branch has long list of WF activities that are being executed.
The second branch should periodically query the workflow just to find which task is currently being executed. Can this be done ?
Regards,
DG
Views
Replies
Total Likes
Hey @Marcel_Szimonisz,
Could you please help @dganguly further with their query here?
Thanks!
Views
Replies
Total Likes
Hi @dganguly ,
You should be able to look in the xtk:workflowTask schema using the workflow ID (which you will need to get from the xtk:workflow schema using the workflow internal name) and see which activities have a value in the "Running" column with a value of "Pending" in the Status column. You might be able to get away with just looking at the "Pending" status but I haven't had a chance to play around with it to know if it can be used without the "Running" column.
Hi @dganguly
You can use the below code to logInfo the activities that is running for the current workflows.
var query = xtk.queryDef.create(
<queryDef schema="xtk:workflowTask" operation="select" >
<select>
<node expr="[workflow/@internalName]"/>
<node expr="[workflow/@label]"/>
<node expr="@activity"/>
<node expr="@runningDate"/>
<node expr="@status"/>
</select>
<where>
<condition boolOperator="AND" expr={"[workflow/@internalName] = '"+instance.internalName+"'"} />
<condition expr={"@status = '0'"} />
</where>
</queryDef>);
var record = query.ExecuteQuery();
if (Object.keys(record).length>0)
{
for each(var recRecord1 in record)
{
if(recRecord1.@runningDate!='')
{
logInfo("The running Activity is "+recRecord1.@activity);
}
}
}
Regards
A
Views
Likes
Replies