cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti editor - read only mode

breakline
Champ in-the-making
Champ in-the-making
Hi!

Is there a simple way to implement a read only editor? We implemented our own diagram behavior class based on DiagramBehavior.java The class DiagramBehavior has this function we figured we should override:


private void setConfigurationProvider(IConfigurationProviderInternal configurationProvider) {
      this.configurationProvider = configurationProvider;

      // initialize configuration-provider depending on this editor
      configurationProvider.setWorkbenchPart(parentPart);

      if (diagramContainer.getGraphicalViewer() != null) {
         initializeGraphicalViewer();
      }

      if (diagramContainer instanceof IEditorPart) {
         DefaultEditDomain editDomain = new DefaultEditDomain((IEditorPart) diagramContainer);
         diagramContainer.setEditDomain(editDomain);
      }

      CommandStack commandStack = new GFCommandStack(configurationProvider, getEditingDomain());
      getEditDomain().setCommandStack(commandStack);
   }


But since this function is private we cannot override it.  But this function sets the editing domain as well as the command stack. So we're stuck with this for now.

Is there any easy way to implement a read-only functionality? As far as I can tell we need to set our own EditDomain for that? Is there a way to set the Edit Domain later? Maybe overwrite it?
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

What would be the difference with providing an image of the process diagram?

Best regards,

breakline
Champ in-the-making
Champ in-the-making
Hi!

We'd like to implement a more complex editor with rights management. We're also working on a multi-page editor and want to disable editing if the other pages are dirty. Since this would be much easier than using a separate view which doesnt fit into a multi-page editor part we try to implement the read-only mode for the diagram editor.

So far we implemented our own FeatuerProvider which works just fine. Except refreshing has a lot of problems. We can set a resource changed flag in the update behavior but then it deletes every pictogram but doesnt put the new ones on.  What can cause this?