You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Notice

This page is still under construction

Setting up the workflow

For setting up a workflow in which a simple report is generated, first a couple of files need to be edited or added. These are:

  • Moduledescriptor.xml (not always necessary)
  • (Module instance, eg. Create_Report.xml)
  • (Workflow, eg. Report.xml)
  • TaskrunDialog.xml

Moduledescriptor

Make sure the report class is registered. This can be done in the file Moduledescriptors.xml. It is possible that this class is already registered.

<moduleDescriptor id="Reports">
	<description>Reports</description>
	<className>nl.wldelft.fews.system.plugin.report.ReportController</className>
</moduleDescriptor>

The ID we give to the class is "Reports"

Set-up report module instance

For each report we want FEWS to generate, a separate module instance is created. Each module instance for reporting is saved in the folder "ModuleConfigFiles". In this example we create the file "Create_Report.xml". We start with the next lines:

<?xml version="1.0" encoding="UTF-8"?>
<reports version="1.0" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/reports.xsd">
	<declarations>
		<templateDir>d:\FEWS\FEWS_SA\report\</templateDir>
		<reportsRootDir>d:\FEWS\FEWS_SA_sa\report\</reportsRootDir>
		<sendToLocalFileSystem>true</sendToLocalFileSystem>
	</declarations>
	<report>
		<template>template.htm</template>
		<outputFileName>report.html</outputFileName>
	</report>
</reports>

Later we will expand this module instance.

Workflow for creating the report

For creating the report we will here set up a seperate workflow. Therefore we create a file in the folder "WorkflowFiles", which we call "Report.xml". The file contains the following lines:

<?xml version="1.0" encoding="UTF-8"?>
<workflow xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/workflow.xsd" version="1.1">
	<!--report-->
	<activity>
		<runIndependent>true</runIndependent>
		<moduleInstanceId>Create_Report</moduleInstanceId>
	</activity>
</workflow>

ID

Notice that ModuleInstanceId refers to the name of the file that contains the module instance (ModuleConfigFiles\Create_Report.xml!

Adding the workflow to the list of tasks

To be able to run the workflow manually, it needs to be registered as a task. Therefor in the file "Taskrundialog.xml" in the folder "DisplayConfigFiles" the following information is added:

<simpleTask name="MakeReport" workflowId="report">
	<relativePeriod unit="hour" start="-24" end="0"/>
</simpleTask>

The name, which appears in the tasklist is "MakeReport".

ID

Notice that the WorkflowId is the same as the file which contains the workflow! In this case it is "report", which is the same as the file "\WorkflowFiles\report.xml"!

  • No labels