Is there any way to check from a JSSP page (inside AC) if a specific WF is actually running?
I can't use @state because it's always in "started"
Thanks a lot.
If the workflow is always 'started' because there is a signal or scheduler activity
then you can just query how many activities (except for signals/schedulers) did not finish running - meaning the workflow is currently running.
You can do something like:
instance.vars.workflowId = <your workflow Id>
instance.vars.running=sqlGetDouble("select count(*) from xtkworkflowtask where iworkflowid= " + instance.vars.workflowId + " and tscompletion is null and sactivity <>'schedule' and sactivity <>'signal' ");
if instance.vars.running > 0 then your workflow is currently running.
Hope it helps,
You can also use the following method to check various states/statuses for one/multiple workflows
Here are the enum mappings
9-Request to start in simulation mode
16-Stop in progress
4-Stop in progress