Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note
titleNotice

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.

Code Block
XML
XML
Wiki Markup
{note:title=Notice}
This page is still under construction
{note} 


h3. 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.
{code:XML}
<moduleDescriptor id="Reports">
	<description>Reports</description>
	<className>nl.wldelft.fews.system.plugin.report.ReportController</className>
</moduleDescriptor>
{code}

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:

Code Block
xml
xml

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<fews:reports<reports version="1.0" xmlns:fews="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">
	<fews:declarations><declarations>
		<fews<templateDir>d:templateDir>d:\FEWS\ISAFEWS_HW_saSA\report\</fews:templateDir>
		<fews<reportsRootDir>d:reportsRootDir>d:\FEWS\ISAFEWS_HWSA_sa\report\</fews:reportsRootDir>
		<fews:sendToLocalFileSystem>true<<sendToLocalFileSystem>true</fews:sendToLocalFileSystem>
	</fews:declarations>
	<fews:report><report>
		<fews:template>doc1<template>template.htm</fews:template>
		<fews:outputFileName>report<outputFileName>report.html</fews:outputFileName>
	</fews:report>
</fews:reports>
{xml}




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:

Code Block
xml
xml

<?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>
Info
titleID

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:

Code Block
xml
xml

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

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

Info
titleID

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"!