Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Best way for Workflows and Wizards
Best way for Workflows and Wizards [message #1386130] Fri, 13 June 2014 09:57 Go to next message
Eclipse UserFriend
Hi there,

I tried to use the workflow concept, but i do not have any idea how it should work.
The page within the wiki (https://wiki.eclipse.org/Scout/Concepts/Workflow) is not very useful. There are also three posts in the forum, but they are also not useful. Same with Google.

Does anyone used Workflows yet and has a small snippet or advice how i define a workflow (and its steps) and how i can start it, for example from a wizard?


And there is something confusing to me:
When I create a new workflow service (I choose "AbstractWorkflowService" for creating a new service on the server), scout does not create a class that extends AbstractWorkflowService, but uses AbstractService instead. Is this a bug!?

I'm using Scout 4.0 with Eclipse 3.8 target.

Thanks!
Re: Best way for Workflows and Wizards [message #1386541 is a reply to message #1386130] Wed, 18 June 2014 04:09 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

i use the workflow wizard in an application. In the way I used it, it is only a client side feature to show multiple forms that are related in some way.

So with the wizard I created 4 steps and each step has it own form. Each form has its own service on the server. So the first form loads some data and the user has to make a choice out of this data. Then he skips to the next page. At that moment the data that is needed for the next page, is saved in local variables of the wizard. Code below is my first step.

  @Order(10.0)
  public class BepaalSelectieStep extends AbstractWizardStep {

    ImportDBCWizardBepaalSelectieForm m_form;

    @Override
    protected String getConfiguredTitle() {
      return TEXTS.get("ImportDBCWizardBepaalSelectie");
    }

    @Override
    protected void execActivate(int stepKind) throws ProcessingException {
      m_form = (ImportDBCWizardBepaalSelectieForm) getForm();
      if (m_form == null) {
        m_form = new ImportDBCWizardBepaalSelectieForm();
        m_form.startWizardStep(this, ImportDBCWizardBepaalSelectieForm.ModifyHandler.class);
        setForm(m_form);
      }
      getWizard().setWizardForm(m_form);
    }

    @Override
    protected void execDeactivate(int stepKind) throws ProcessingException {
      ImportDBCWizardBepaalSelectieForm form = (ImportDBCWizardBepaalSelectieForm) getForm();
      setVestigingNaam(form.getVestigingField().getDisplayText());
      Integer jaar = form.getJaarField().getValue();
      Integer maand = form.getMaandField().getValue();
      setBeginDatum(Conversion.getDateMinimum(jaar, maand));
      setEindDatum(Conversion.getDateMaximum(jaar, maand));
    }
  }



In the modify handler of the second form I retrieve these variables of the wizard and set them in the second form. See code below.

  public class ModifyHandler extends AbstractFormHandler {

    @Override
    public void execLoad() throws ProcessingException {
      ImportDBCWizard wizard = (ImportDBCWizard) getWizard();
      setVestigingNaam(wizard.getVestigingNaam());
      setBeginDatum(wizard.getBeginDatum());
      setEindDatum(wizard.getEindDatum());
      IImportDBCWizardGeselecteerdeDBCsProcessService service = SERVICES.getService(IImportDBCWizardGeselecteerdeDBCsProcessService.class);
      ImportDBCWizardGeselecteerdeDBCsFormData formData = new ImportDBCWizardGeselecteerdeDBCsFormData();
      exportFormData(formData);
      formData = service.load(formData);
      importFormData(formData);
      setEnabledPermission(new UpdateImportDBCWizardGeselecteerdeDBCsPermission());
    }

    @Override
    public void execStore() throws ProcessingException {
      IImportDBCWizardGeselecteerdeDBCsProcessService service = SERVICES.getService(IImportDBCWizardGeselecteerdeDBCsProcessService.class);
      ImportDBCWizardGeselecteerdeDBCsFormData formData = new ImportDBCWizardGeselecteerdeDBCsFormData();
      exportFormData(formData);
      formData = service.store(formData);
    }
  }



So the wizard presents the forms that are added in the steps and I pass the data in my own code from one form to the other by usin local variables of the wizard.

Hope this helps,

regards Bertin


Re: Best way for Workflows and Wizards [message #1387515 is a reply to message #1386541] Wed, 25 June 2014 03:38 Go to previous message
Eclipse UserFriend
Thanks for this.

So, I will look how I can implement workflows according to my opinion.

If I will have some new knowledge, I will share it here!
Previous Topic:Number field with a minValue but no maxValue
Next Topic:Is there a DropdownBox?
Goto Forum:
  


Current Time: Tue Jul 15 11:54:45 EDT 2025

Powered by FUDForum. Page generated in 0.04020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top