To initiate a workflow from a web application you can simply build a html link with the appropriate initiation parameters.
Check out the org.jharks.workflow.survey.engine.gui.taglib.PresentationConstants
for corresponding parameter constants.
PresentationConstants.START_WORKFLOW_INDICATOR
).PresentationConstants: STATE
).PresentationConstants.WORKFLOW_DEFINITION_FILE
).Note: If fileResource is true then you need to specify the workflowDefinitionFile parameter to indicate which physical file should be retrieved to initiate the workflow and the
workflowKeyLabel which will be used as the key to store references within workflow registries for the application instance. If fileResource is false you only need to specify the workflowKeyLabel. The workflowKeyLabel must match the identifier used to store the workflow definition in a stream repository. Currently the jharks workflow-survey-engine
library supports workflow definitions being stored in a Oracle database repository in the XML_WORKFLOW_DEFINITION table. The workflowKeyLabel must match the value defined within the DEFINITION_NAME column of the XML_WORKFLOW_DEFINITION table.
Jharks is working on providing integrator packages to allow for easy integration into various web frameworks.
The integrator package will provide a class org.chboston.workflow.survey.engine.web.struts.GenericWorkflowAction
and an example action SurveyEngineFrontAction
. The GenericWorkflowAction
extends the Struts library Action
class and can be further extended by your custom Struts action that you will like to use as a front controller to jharks workflow backed web surveys.
The SurveyEngineFrontAction
shows how to implement an extension of the GenericWorkflowAction
and logic that would need to be included.
The key part of the code is to determine whether a continuation of the survey-workflow is occurring or whether it is just being initialized.
Check out the start guide for a Struts Application [StartGuideForStrutsApp]
Wiki: Home
Wiki: StartGuideForStrutsApp
Anonymous