Skip to main content
Last updated May 30, 2013 06:52, by Ralph


The marty util project provides a general controller bean to process workitems, called 'org.imixs.marty.workflow.WorkflowController'. This bean is used in session scope and holds a reference to the currently process workitem. The controller is independent from the type of workitem. So it is uses to not only process workitems of the main workflow but also project or profile workitems. The controller subclasses the org.imixs.workflow.jee.faces.workitem.WorkflowController and provides additional business logic. The WorkflowController provides easy acccess to properties of a workitem, so you can bind input fields to specific properties of a workitem:

 <h:panelGroup layout="block"  >
  <h:outputLabel value="#{workitemMB.item['txtaddress']}" />
  <h:outputLabel value="#{workitemMB.item['txtzip']} #{workitemMB.item['txtcity']}" />
  <h:outputLabel value="#{workitemMB.item['txtstate']}" />
  <h:outputLabel value="#{workitemMB.item['txtcountry']}" />

Editor Sections

The workflowController analyses the txtWorkflowEditorID property and provides these information to setup custom xthml forms. The marty web module provides some basis from layout to spearate form sections e.g. in tabs:

   <div class="imixs-tabs">
	  <c:forEach items="#{workflowController.editorSections}"
		 <li><a href="#tab-#{}">#{}</a></li>
	<c:forEach items="#{workflowController.editorSections}" var="section">
	 <div id="tab-#{}">
		<ui:include src="/pages/workitems/forms/#{section.url}.xhtml" />


The WorkflowController fires events depending on the state of the workitem which can be consumed by other CDI beans in an applicaton. The event handling is implemented using the CDI observer pattern (JSR-299/JSR-330). To consume an event a CDI bean have to implement a method with a @Observes annotation for the WorkflowEvent.

    public void onWorkflowEvent(@Observes WorkflowEvent workflowEvent) {

The Events are only triggered by the CDI Bean WorkflowController. If a Workitem is updated or processed by the WorkflowService EJB directyl in the backend (e.g. from the TimerSerivce) no events will be fired.


Fired during the workflowController is initialized


Fired after a new empty woritem was created


Fired when the workitem has changed (method setWorkitem() called). The event is typical fired if a workitem was clicked by the user in a view. Note: this event is not fired if a workitem was created or during it is processed!


Fired before a workitem will be processed by the workflow engine


Fired after a workitem was processed by the workflow engine


Before a workitem will be archived


After a workitem was archived


Before a workitem is soft deleted


After a workitem was soft deleted


Before a workitem is restored from the archive


After a worktiem was restored from the archive


Before restore from soft delete


After restore from soft delete


The backing Bean org.imixs.marty.web.workitem.WorklistController is used to manage collections of workitems. The bean is used in view scope to display the current result set of a worklist selection or a search result:

 <h:dataTable var="workitem" value="#{worklistController.workitems}">

The WorklistMB also provides methods to navigate through a list of workitems (also called paging)

   <h:commandButton actionListener="#{worklistController.doLoadPrev}"
    disabled="#{worklistMB.row==0}" value="#{global.prev}">
   <h:commandButton actionListener="#{worklistMB.doLoadNext}"
 	disabled="#{worklistMB.endOfList}" value="#{}">
Please Confirm