Exemplo n.º 1
0
 /* package private */
 internal virtual TransitionImpl GetTransition(String transitionName, StateImpl state, DbSession dbSession)
 {
     TransitionImpl transition = null;
     if ((Object)transitionName != null)
     {
         Object[] values = new Object[] { transitionName, state.Id };
         IType[] types = new IType[] { DbType.STRING, DbType.LONG };
         transition = (TransitionImpl)dbSession.FindOne(queryFindTransitionByName, values, types);
     }
     else
     {
         ISet leavingTransitions = state.LeavingTransitions;
         if (leavingTransitions.Count == 1)
         {
             IEnumerator transEnum = leavingTransitions.GetEnumerator();
             transEnum.MoveNext();
             transition = (TransitionImpl)transEnum.Current;
         }
         else
         {
             throw new SystemException("no transitionName was specified : this is only allowed if the state (" + state.Name + ") has exactly 1 leaving transition (" + leavingTransitions.Count + ")");
         }
     }
     return transition;
 }
Exemplo n.º 2
0
        internal virtual TransitionImpl FindLeavingTransitionByName(long nodeId,string transitionName, DbSession dbSession)
        {
            Object[] values = new Object[] { nodeId, transitionName };
            IType[] types = new IType[] { DbType.LONG, DbType.STRING };

            return (TransitionImpl)dbSession.FindOne(queryFindLeavingTransitionByName, values, types);
        }
Exemplo n.º 3
0
		public IProcessDefinition GetProcessDefinition(String processDefinitionName, Relations relations, DbSession dbSession)
		{
			ProcessDefinitionImpl processDefinition = null;
			processDefinition = (ProcessDefinitionImpl) dbSession.FindOne(queryFindProcessDefinitionByName, processDefinitionName, DbType.STRING);
			if (relations != null)
			{
				relations.Resolve(processDefinition);
			}
			return processDefinition;
		}
Exemplo n.º 4
0
		public BankAccount GetBankAccount(string bank, string costumer, DbSession dbSession)
		{
			log.Debug("GetBankAccount");
			BankAccount bankAccount = null;

			Object[] values = new Object[] {bank, costumer};
			IType[] types = new IType[] {DbType.STRING, DbType.STRING};

			bankAccount = (BankAccount) dbSession.FindOne(queryFindBankAccount,values,types);
			return bankAccount;
		}
Exemplo n.º 5
0
		// method implementations ////////////////////////////////////////////
		public IActor FindActorById(String actorName, Relations relations, DbSession dbSession)
		{
			IActor actor = null;
			try
			{
				actor = (IActor) dbSession.FindOne(queryFindActorById, actorName, DbType.STRING);
				if (relations != null)
					relations.Resolve(actor);
			}
			catch (Exception t)
			{
				throw new OrganisationRuntimeException("organisation-exception : coudn't find actor '" + actorName + "' by name : " + t.Message);
			}
			return actor;
		}
Exemplo n.º 6
0
		public IGroup FindGroupByMembership(String userId, String membershipType, Relations relations, DbSession dbSession)
		{
			IGroup group = null;
			try
			{
				Object[] args = new Object[] {userId, membershipType};
				IType[] types = new IType[] {DbType.STRING, DbType.STRING};
				group = (IGroup) dbSession.FindOne(queryFindGroupByMembership, args, types);
				if (relations != null)
					relations.Resolve(group);
			}
			catch (Exception t)
			{
				throw new OrganisationRuntimeException("organisation-exception : coudn't find group by membership by user '" + userId + "' and membership-type '" + membershipType + "' : " + t.Message);
			}
			return group;
		}