Esempio n. 1
0
            private WorkflowIdentity Parse()
            {
                if (!ExtractName())
                {
                    return(null);
                }
                if (!ExtractVersion())
                {
                    return(null);
                }
                if (!ExtractPackage())
                {
                    return(null);
                }

                Fx.Assert(!_name.Contains(";"), "Regex should not have matched semi-colon");
                Fx.Assert(!HasLeadingOrTrailingWhitespace(_name), "Whitespace should have been stripped");
                Fx.Assert(_package == null || !HasLeadingOrTrailingWhitespace(_package), "Whitespace should have been stripped");

                WorkflowIdentity result = new WorkflowIdentity();

                result._name    = _name;
                result._version = _version;
                result._package = _package;
                return(result);
            }
Esempio n. 2
0
 internal WorkflowApplicationInstance(
     WorkflowApplication.PersistenceManagerBase persistenceManager,
     IDictionary <XName, InstanceValue> values,
     WorkflowIdentity definitionIdentity)
 {
     this.PersistenceManager = persistenceManager;
     this.Values             = values;
     this.DefinitionIdentity = definitionIdentity;
     _state = (int)State.Initialized;
 }
Esempio n. 3
0
 private static string GetMessage(WorkflowIdentity expectedVersion, WorkflowIdentity actualVersion)
 {
     if (actualVersion == null && expectedVersion != null)
     {
         return(SR.WorkflowIdentityNullStateId(expectedVersion));
     }
     else if (actualVersion != null && expectedVersion == null)
     {
         return(SR.WorkflowIdentityNullHostId(actualVersion));
     }
     else if (!object.Equals(expectedVersion, actualVersion))
     {
         return(SR.WorkflowIdentityStateIdHostIdMismatch(actualVersion, expectedVersion));
     }
     else
     {
         return(null);
     }
 }
Esempio n. 4
0
 public VersionMismatchException(string message, WorkflowIdentity expectedVersion, WorkflowIdentity actualVersion, Exception innerException)
     : base(message, innerException)
 {
     this.ExpectedVersion = expectedVersion;
     this.ActualVersion   = actualVersion;
 }
Esempio n. 5
0
 public VersionMismatchException(WorkflowIdentity expectedVersion, WorkflowIdentity actualVersion)
     : base(GetMessage(expectedVersion, actualVersion))
 {
     this.ExpectedVersion = expectedVersion;
     this.ActualVersion   = actualVersion;
 }