Skip to main content
summaryrefslogtreecommitdiffstats
blob: 6172ac1a59935ec36c45fcc8500b999afd1b2cd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2011 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ats.core.workflow.transition;

/**
 * @author Donald G. Dunne
 */
public class TransitionResult implements ITransitionResult {

   public static TransitionResult MUST_BE_TARGETED_FOR_VERSION = new TransitionResult(
      "Actions must be targeted for a Version.  Please set \"Target Version\" before transition.");
   public static TransitionResult NO_WORKFLOWS_PROVIDED_FOR_TRANSITION = new TransitionResult(
      "No Workflows provided for transition; aborting.");
   public static TransitionResult TO_STATE_CANT_BE_NULL = new TransitionResult(
      "To-State can not be null for transition.");
   public static TransitionResult MUST_BE_ASSIGNED =
      new TransitionResult(
         "You must be assigned to transition this workflow.\nContact Assignee or Select Priviledged Edit for Authorized Overriders.");
   public static TransitionResult DELETE_WORKING_BRANCH_BEFORE_CANCEL = new TransitionResult(
      "Working Branch exists.\n\nPlease delete working branch before transition to cancel.");
   public static TransitionResult WORKING_BRANCH_BEING_COMMITTED = new TransitionResult(
      "Working Branch is being Committed.\n\nPlease wait till commit completes to transition.");
   public static TransitionResult WORKING_BRANCH_EXISTS = new TransitionResult(
      "Working Branch exists.\n\nPlease commit or delete working branch before transition.");
   public static TransitionResult CAN_NOT_TRANSITION_WITH_SYSTEM_USER_ASSIGNED = new TransitionResult(
      "Can not transition with \"Guest\", or \"OseeSystem\" user as assignee.");
   public static TransitionResult CAN_NOT_TRANSITION_AS_SYSTEM_USER = new TransitionResult(
      "Can not transition as \"Guest\", or \"OseeSystem\".");
   public static TransitionResult COMPLETE_BLOCKING_REVIEWS = new TransitionResult(
      "All Blocking Reviews must be completed before transition.");
   public static TransitionResult TASKS_NOT_COMPLETED = new TransitionResult("Tasks Not Completed");

   private final String details;
   private final Exception exception;

   public TransitionResult(String details, Exception ex) {
      this.details = details;
      this.exception = ex;
   }

   public TransitionResult(String details) {
      this(details, null);
   }

   @Override
   public String getDetails() {
      return details;
   }

   @Override
   public String toString() {
      return getDetails();
   }

   @Override
   public Exception getException() {
      return exception;
   }

}

Back to the top