• Repeated Workflow instance

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #48635  by w12315007
 
Hi, we came accross a very strange issue during we developed a file workflow. We developed a file workflow with run_config and loaded it in openkm. The openkm created two repeated workflow instance with same created time when we executed the workflow. But we developed other file workflow without run_config,the openkm created a wokflow instance normally. we didn't what caused this issue, have any idea this?
 #48672  by w12315007
 
Hi, we debugged the source code for this problem,we found the program will run the following code when the workflow with run_config,
Code: Select all
	public void runProcessDefinition() {
		if (drawed) {
			if (manager.getValidationProcessor().validate()) {
				runProcessDefinitionWithValues();
			} else {
				workflowWidgetToFire.hasPendingProcessDefinitionForms();
			}
		} else {
			getProcessDefinitionForms(name);
		}
	}
the condition, manager.getValidationProcessor().validate(),will return true, so it will call runProcessDefinitionWithValues() which create a workflow instance, but manager.getValidationProcessor().validate() as following:
Code: Select all
public boolean validate(List<String> uuids, String... names) {
		this.uuids = uuids;
		result = true;
		pluginsValidated = 0;
		result = result && super.validate(names);
		// Always evaluate plugins rpc calls at ends
		if (plugins > 0 && validatorToFire != null) {
			waitUntilValidatorsFinished();
		} else if (plugins == 0 && validatorToFire != null) {
			validatorToFire.validationWithPluginsFinished(result);
		}
		return result;
	}
it will call the validatorToFire.validationWithPluginsFinished(result), this funciton also includes a runProcessDefinitionWithValues() as following:
Code: Select all
	public void validationWithPluginsFinished(boolean result) {
		if (result) {
			runProcessDefinitionWithValues();
		} else {
			workflowWidgetToFire.hasPendingProcessDefinitionForms();
		}
	}
it will again call runProcessDefinitionWithValues() which will create second workflow instance.
I did not understand function of manager.getValidationProcessor().validate(), so why it need call runProcessDefinitionWithValues() again. May it is a bug or my configuration issue?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.