Package org.jboss.bpm.console.client.model

Examples of org.jboss.bpm.console.client.model.ProcessInstanceRef


                      public void onClick(ClickEvent clickEvent)
                      {
                          String diagramUrl = getCurrentDefintion().getDiagramUrl();
                          if(diagramUrl !=null && !diagramUrl.equals(""))
                          {
                              final ProcessInstanceRef selection = getCurrentInstance();
                              if(selection!=null)
                              {
                                  createDiagramWindow(selection);
 
                                  DeferredCommand.addCommand(new Command()
                                  {
                                      public void execute() {
                                          controller.handleEvent(
                                                  new Event(LoadInstanceActivityImage.class.getName(), selection)
                                          );
                                      }
                                  }
                                  );
 
                              }
                          }
                          else
                          {
                              MessageBox.alert("Incomplete deployment", "No diagram associated with process");
                          }
                      }
                  }
          );
        } else if(isjBPMInstance) {
          diagramBtn = new Button("Diagram",
                  new ClickHandler()
                  {
                    public void onClick(ClickEvent clickEvent)
                    {
                      String diagramUrl = getCurrentDefintion().getDiagramUrl();
                      if(diagramUrl !=null && !diagramUrl.equals(""))
                      {
                        ProcessInstanceRef selection = getCurrentInstance();
                        if(selection!=null)
                        {
                          createDiagramWindow(selection);
                          controller.handleEvent(
                              new Event(LoadActivityDiagramAction.ID, selection)
View Full Code Here


                        public void onRowSelection(RowSelectionEvent rowSelectionEvent)
                        {
                            int index = listBox.getSelectedIndex();
                            if(index!=-1)
                            {
                                ProcessInstanceRef item = listBox.getItem(index);

                                // enable or disable signal button depending on current activity
                                if (isSignalable(item)) {
                                    signalBtn.setEnabled(true);
                                } else {
                                    signalBtn.setEnabled(false);
                                }

                                terminateBtn.setEnabled(true);

                                // update details
                                controller.handleEvent(
                                        new Event(UpdateInstanceDetailAction.ID,
                                                new InstanceEvent(currentDefinition, item)
                                        )
                                );
                            }
                        }
                    }
            );

            // toolbar
            final MosaicPanel toolBox = new MosaicPanel();

            toolBox.setPadding(0);
            toolBox.setWidgetSpacing(5);

            final ToolBar toolBar = new ToolBar();
            refreshBtn = new Button("Refresh", new ClickHandler() {

                public void onClick(ClickEvent clickEvent) {
                    controller.handleEvent(
                            new Event(
                                    UpdateInstancesAction.ID,
                                    getCurrentDefinition()
                            )
                    );
                }
            }
            );
            toolBar.add(refreshBtn);
            refreshBtn.setEnabled(false);
            toolBar.addSeparator();

            startBtn = new Button("Start", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    MessageBox.confirm("Start new execution",
                            "Do you want to start a new execution of this process?",
                            new MessageBox.ConfirmationCallback()
                            {
                                public void onResult(boolean doIt)
                                {
                                    if (doIt)
                                    {
                                        String url = getCurrentDefinition().getFormUrl();
                                        boolean hasForm = (url != null && !url.equals(""));
                                        if (hasForm)
                                        {
                                            ProcessDefinitionRef definition = getCurrentDefinition();
                                            iframeWindow = new IFrameWindowPanel(
                                                    definition.getFormUrl(), "New Process Instance: " + definition.getId()
                                            );

                                            iframeWindow.setCallback(
                                                    new IFrameWindowCallback()
                                                    {
                                                        public void onWindowClosed()
                                                        {
                                                            controller.handleEvent(
                                                                    new Event(UpdateInstancesAction.ID, getCurrentDefinition())
                                                            );
                                                        }
                                                    }
                                            );

                                            iframeWindow.show();
                                        }
                                        else
                                        {
                                            controller.handleEvent(
                                                    new Event(
                                                            StartNewInstanceAction.ID,
                                                            getCurrentDefinition()
                                                    )
                                            );
                                        }
                                    }

                                }
                            });

                }
            }
            );


            terminateBtn = new Button("Terminate", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    if (getSelection() != null)
                    {

                        MessageBox.confirm("Terminate instance",
                                "Terminating this instance will stop further execution.",
                                new MessageBox.ConfirmationCallback()
                                {
                                    public void onResult(boolean doIt)
                                    {
                                        if (doIt)
                                        {
                                            ProcessInstanceRef selection = getSelection();
                                            selection.setState(ProcessInstanceRef.STATE.ENDED);
                                            selection.setEndResult(ProcessInstanceRef.RESULT.OBSOLETE);
                                            controller.handleEvent(
                                                    new Event(
                                                            StateChangeAction.ID,
                                                            selection
                                                    )
                                            );
                                        }
                                    }
                                });
                    }
                    else
                    {
                        MessageBox.alert("Missing selection", "Please select an instance");
                    }
                }
            }
            );           


            deleteBtn = new Button("Delete", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    if (getSelection() != null)
                    {
                        MessageBox.confirm("Delete instance",
                                "Deleting this instance will remove any history information and associated tasks as well.",
                                new MessageBox.ConfirmationCallback()
                                {
                                    public void onResult(boolean doIt)
                                    {

                                        if (doIt)
                                        {
                                            ProcessInstanceRef selection = getSelection();
                                            selection.setState(ProcessInstanceRef.STATE.ENDED);

                                            controller.handleEvent(
                                                    new Event(
                                                            DeleteInstanceAction.ID,
                                                            selection
View Full Code Here

        }
    }

    public ProcessInstanceRef getSelection()
    {
        ProcessInstanceRef selection = null;
        if(listBox.getSelectedIndex()!=-1)
            selection = listBox.getItem( listBox.getSelectedIndex());
        return selection;
    }
View Full Code Here

  )
  {
    FieldMapping mapping = createFieldMapping(payload);

    // start process
    ProcessInstanceRef instance =
        getProcessManagement().newInstance(definitionId, mapping.processVars);

    return Response.ok(SUCCESSFULLY_PROCESSED_INPUT).build();
  }
View Full Code Here

  public Response newInstance(
      @PathParam("id")
      String definitionId)
  {

    ProcessInstanceRef instance = null;
    try
    {
      instance = getProcessManagement().newInstance(definitionId);
      return createJsonResponse(instance);
    }
View Full Code Here

  )
  {
    FieldMapping mapping = createFieldMapping(payload);

    // start process
    ProcessInstanceRef instance =
        getProcessManagement().newInstance(definitionId, mapping.processVars);

    return Response.ok(SUCCESSFULLY_PROCESSED_INPUT).build();
  }
View Full Code Here

  )
  {
    FieldMapping mapping = createFieldMapping(payload);

    // start process
    ProcessInstanceRef instance =
        getProcessManagement().newInstance(definitionId, mapping.processVars);

    return Response.ok(SUCCESSFULLY_PROCESSED_INPUT).build();
  }
View Full Code Here

  )
  {
    FieldMapping mapping = createFieldMapping(payload);

    // start process
    ProcessInstanceRef instance =
        getProcessManagement().newInstance(definitionId, mapping.processVars);

    return Response.ok("Successfully processed input").build();
  }
View Full Code Here

  )
  {
    Map<String,Object> processVars = createVariableMapping(payload);

    // start process
    ProcessInstanceRef instance = getProcessManagement().newInstance(definitionId, processVars);

    return Response.ok("Successfully processed input").build();
  }
View Full Code Here

                        public void onRowSelection(RowSelectionEvent rowSelectionEvent)
                        {
                            int index = listBox.getSelectedIndex();
                            if(index!=-1)
                            {
                                ProcessInstanceRef item = listBox.getItem(index);

                                // enable or disable signal button depending on current activity
                                if (isSignalable(item)) {
                                    signalBtn.setEnabled(true);
                                } else {
                                    signalBtn.setEnabled(false);
                                }

                                terminateBtn.setEnabled(true);

                                // update details
                                controller.handleEvent(
                                        new Event(UpdateInstanceDetailAction.ID,
                                                new InstanceEvent(currentDefinition, item)
                                        )
                                );
                            }
                        }
                    }
            );

            // toolbar
            final MosaicPanel toolBox = new MosaicPanel();

            toolBox.setPadding(0);
            toolBox.setWidgetSpacing(5);

            final ToolBar toolBar = new ToolBar();
            refreshBtn = new Button("Refresh", new ClickHandler() {

                public void onClick(ClickEvent clickEvent) {
                    controller.handleEvent(
                            new Event(
                                    UpdateInstancesAction.ID,
                                    getCurrentDefinition()
                            )
                    );
                }
            }
            );
            toolBar.add(refreshBtn);
            refreshBtn.setEnabled(false);
            toolBar.addSeparator();

            startBtn = new Button("Start", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    MessageBox.confirm("Start new execution",
                            "Do you want to start a new execution of this process?",
                            new MessageBox.ConfirmationCallback()
                            {
                                public void onResult(boolean doIt)
                                {
                                    if (doIt)
                                    {
                                        String url = getCurrentDefinition().getFormUrl();
                                        boolean hasForm = (url != null && !url.equals(""));
                                        if (hasForm)
                                        {
                                            ProcessDefinitionRef definition = getCurrentDefinition();
                                            iframeWindow = new IFrameWindowPanel(
                                                    definition.getFormUrl(), "New Process Instance: " + definition.getId()
                                            );

                                            iframeWindow.setCallback(
                                                    new IFrameWindowCallback()
                                                    {
                                                        public void onWindowClosed()
                                                        {
                                                            controller.handleEvent(
                                                                    new Event(UpdateInstancesAction.ID, getCurrentDefinition())
                                                            );
                                                        }
                                                    }
                                            );

                                            iframeWindow.show();
                                        }
                                        else
                                        {
                                            controller.handleEvent(
                                                    new Event(
                                                            StartNewInstanceAction.ID,
                                                            getCurrentDefinition()
                                                    )
                                            );
                                        }
                                    }

                                }
                            });

                }
            }
            );


            terminateBtn = new Button("Terminate", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    if (getSelection() != null)
                    {

                        MessageBox.confirm("Terminate instance",
                                "Terminating this instance will stop further execution.",
                                new MessageBox.ConfirmationCallback()
                                {
                                    public void onResult(boolean doIt)
                                    {
                                        if (doIt)
                                        {
                                            ProcessInstanceRef selection = getSelection();
                                            selection.setState(ProcessInstanceRef.STATE.ENDED);
                                            selection.setEndResult(ProcessInstanceRef.RESULT.OBSOLETE);
                                            controller.handleEvent(
                                                    new Event(
                                                            StateChangeAction.ID,
                                                            selection
                                                    )
                                            );
                                        }
                                    }
                                });
                    }
                    else
                    {
                        MessageBox.alert("Missing selection", "Please select an instance");
                    }
                }
            }
            );           


            deleteBtn = new Button("Delete", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    if (getSelection() != null)
                    {
                        MessageBox.confirm("Delete instance",
                                "Deleting this instance will remove any history information and associated tasks as well.",
                                new MessageBox.ConfirmationCallback()
                                {
                                    public void onResult(boolean doIt)
                                    {

                                        if (doIt)
                                        {
                                            ProcessInstanceRef selection = getSelection();
                                            selection.setState(ProcessInstanceRef.STATE.ENDED);

                                            controller.handleEvent(
                                                    new Event(
                                                            DeleteInstanceAction.ID,
                                                            selection
View Full Code Here

TOP

Related Classes of org.jboss.bpm.console.client.model.ProcessInstanceRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.