|
@@ -45,6 +45,7 @@ mapEnums wfmodes[] =
|
|
{ WFModeBeginWait, "bwait" },
|
|
{ WFModeBeginWait, "bwait" },
|
|
{ WFModeWait, "wait" },
|
|
{ WFModeWait, "wait" },
|
|
{ WFModeOnce, "once" },
|
|
{ WFModeOnce, "once" },
|
|
|
|
+ { WFModeCritical, "critical" },
|
|
{ WFModeSize, NULL}
|
|
{ WFModeSize, NULL}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -162,6 +163,7 @@ public:
|
|
virtual unsigned queryPersistWfid() const { return tree->getPropInt("@persistWfid", 0); }
|
|
virtual unsigned queryPersistWfid() const { return tree->getPropInt("@persistWfid", 0); }
|
|
virtual int queryPersistCopies() const { return tree->getPropInt("@persistCopies", 0); }
|
|
virtual int queryPersistCopies() const { return tree->getPropInt("@persistCopies", 0); }
|
|
virtual bool queryPersistRefresh() const { return tree->getPropBool("@persistRefresh", true); }
|
|
virtual bool queryPersistRefresh() const { return tree->getPropBool("@persistRefresh", true); }
|
|
|
|
+ virtual IStringVal & getCriticalName(IStringVal & val) const { val.set(tree->queryProp("@criticalName")); return val; }
|
|
virtual IStringVal & queryCluster(IStringVal & val) const { val.set(tree->queryProp("@cluster")); return val; }
|
|
virtual IStringVal & queryCluster(IStringVal & val) const { val.set(tree->queryProp("@cluster")); return val; }
|
|
virtual void setScheduledNow() { tree->setPropTree("Schedule", createPTree()); setEnum(tree, "@state", WFStateReqd, wfstates); }
|
|
virtual void setScheduledNow() { tree->setPropTree("Schedule", createPTree()); setEnum(tree, "@state", WFStateReqd, wfstates); }
|
|
virtual void setScheduledOn(char const * name, char const * text) { IPropertyTree * stree = createPTree(); stree->setProp("@name", name); stree->setProp("@text", text); tree->setPropTree("Schedule", createPTree())->setPropTree("Event", stree); setEnum(tree, "@state", WFStateWait, wfstates); }
|
|
virtual void setScheduledOn(char const * name, char const * text) { IPropertyTree * stree = createPTree(); stree->setProp("@name", name); stree->setProp("@text", text); tree->setPropTree("Schedule", createPTree())->setPropTree("Event", stree); setEnum(tree, "@state", WFStateWait, wfstates); }
|
|
@@ -176,6 +178,7 @@ public:
|
|
tree->setPropInt("@persistCopies", (int)numPersistInstances);
|
|
tree->setPropInt("@persistCopies", (int)numPersistInstances);
|
|
tree->setPropBool("@persistRefresh", refresh);
|
|
tree->setPropBool("@persistRefresh", refresh);
|
|
}
|
|
}
|
|
|
|
+ virtual void setCriticalInfo(char const * name) { tree->setProp("@criticalName", name);}
|
|
virtual void setCluster(const char * cluster) { tree->setProp("@cluster", cluster); }
|
|
virtual void setCluster(const char * cluster) { tree->setProp("@cluster", cluster); }
|
|
//info set at run time
|
|
//info set at run time
|
|
virtual unsigned queryScheduleCountRemaining() const { assertex(tree->hasProp("Schedule")); return tree->getPropInt("Schedule/@countRemaining"); }
|
|
virtual unsigned queryScheduleCountRemaining() const { assertex(tree->hasProp("Schedule")); return tree->getPropInt("Schedule/@countRemaining"); }
|
|
@@ -352,6 +355,7 @@ private:
|
|
unsigned persistWfid;
|
|
unsigned persistWfid;
|
|
int persistCopies;
|
|
int persistCopies;
|
|
bool persistRefresh;
|
|
bool persistRefresh;
|
|
|
|
+ SCMStringBuffer criticalName;
|
|
StringAttr eventName;
|
|
StringAttr eventName;
|
|
StringAttr eventExtra;
|
|
StringAttr eventExtra;
|
|
|
|
|
|
@@ -387,6 +391,7 @@ public:
|
|
scheduledWfid = other->queryScheduledWfid();
|
|
scheduledWfid = other->queryScheduledWfid();
|
|
persistCopies = other->queryPersistCopies();
|
|
persistCopies = other->queryPersistCopies();
|
|
persistRefresh = other->queryPersistRefresh();
|
|
persistRefresh = other->queryPersistRefresh();
|
|
|
|
+ other->getCriticalName(criticalName);
|
|
other->queryCluster(clusterName);
|
|
other->queryCluster(clusterName);
|
|
}
|
|
}
|
|
//info set at compile time
|
|
//info set at compile time
|
|
@@ -409,6 +414,7 @@ public:
|
|
virtual unsigned queryPersistWfid() const { return persistWfid; }
|
|
virtual unsigned queryPersistWfid() const { return persistWfid; }
|
|
virtual int queryPersistCopies() const { return persistCopies; }
|
|
virtual int queryPersistCopies() const { return persistCopies; }
|
|
virtual bool queryPersistRefresh() const { return persistRefresh; }
|
|
virtual bool queryPersistRefresh() const { return persistRefresh; }
|
|
|
|
+ virtual IStringVal & getCriticalName(IStringVal & val) const { val.set(criticalName.str()); return val; }
|
|
virtual IStringVal & queryCluster(IStringVal & val) const { val.set(clusterName.str()); return val; }
|
|
virtual IStringVal & queryCluster(IStringVal & val) const { val.set(clusterName.str()); return val; }
|
|
//info set at run time
|
|
//info set at run time
|
|
virtual unsigned queryScheduleCountRemaining() const { return schedule ? schedule->queryCountRemaining() : 0; }
|
|
virtual unsigned queryScheduleCountRemaining() const { return schedule ? schedule->queryCountRemaining() : 0; }
|
|
@@ -721,6 +727,9 @@ bool WorkflowMachine::executeItem(unsigned wfid, unsigned scheduledWfid)
|
|
case WFModePersist:
|
|
case WFModePersist:
|
|
doExecutePersistItem(item);
|
|
doExecutePersistItem(item);
|
|
break;
|
|
break;
|
|
|
|
+ case WFModeCritical:
|
|
|
|
+ doExecuteCriticalItem(item);
|
|
|
|
+ break;
|
|
case WFModeBeginWait:
|
|
case WFModeBeginWait:
|
|
doExecuteBeginWaitItem(item, scheduledWfid);
|
|
doExecuteBeginWaitItem(item, scheduledWfid);
|
|
item.setState(WFStateDone);
|
|
item.setState(WFStateDone);
|