@@ -16,85 +16,7 @@ namespace OpenAuth.App
/// </summary>
public class FlowInstanceApp : BaseApp < FlowInstance >
{
#region <EFBFBD> ύ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/// <summary>
/// <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <CCA3> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ύ<EFBFBD> <E1BDBB>
/// </summary>
/// <param name="processInstanceEntity"></param>
/// <param name="processSchemeEntity"></param>
/// <param name="processOperationHistoryEntity"></param>
/// <param name="processTransitionHistoryEntity"></param>
/// <returns></returns>
public int SaveProcess ( FlowInstance processInstanceEntity ,
FlowInstanceOperationHistory processOperationHistoryEntity , FlowInstanceTransitionHistory processTransitionHistoryEntity = null )
{
try
{
processInstanceEntity . Id = ( processInstanceEntity . Id ) ;
UnitWork . Update ( processInstanceEntity ) ;
processOperationHistoryEntity . InstanceId = processInstanceEntity . Id ;
UnitWork . Add ( processOperationHistoryEntity ) ;
if ( processTransitionHistoryEntity ! = null )
{
processTransitionHistoryEntity . InstanceId = processInstanceEntity . Id ;
UnitWork . Add ( processTransitionHistoryEntity ) ;
}
UnitWork . Save ( ) ;
return 1 ;
}
catch
{
throw ;
}
}
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> <20> <> <EFBFBD> ˽ڵ<CBBD> <DAB5> <EFBFBD>
/// </summary>
/// <param name="sql"></param>
/// <param name="dbbaseId"></param>
/// <param name="processInstanceEntity"></param>
/// <param name="processSchemeEntity"></param>
/// <param name="processOperationHistoryEntity"></param>
/// <param name="delegateRecordEntityList"></param>
/// <param name="processTransitionHistoryEntity"></param>
/// <returns></returns>
public int SaveProcess ( string sql , string dbbaseId , FlowInstance processInstanceEntity , FlowInstanceOperationHistory processOperationHistoryEntity , FlowInstanceTransitionHistory processTransitionHistoryEntity = null )
{
try
{
processInstanceEntity . Id = ( processInstanceEntity . Id ) ;
UnitWork . Update ( processInstanceEntity ) ;
processOperationHistoryEntity . InstanceId = processInstanceEntity . Id ;
UnitWork . Add ( processOperationHistoryEntity ) ;
if ( processTransitionHistoryEntity ! = null )
{
processTransitionHistoryEntity . InstanceId = processInstanceEntity . Id ;
UnitWork . Add ( processTransitionHistoryEntity ) ;
}
//if (!string.IsNullOrEmpty(dbbaseId) && !string.IsNullOrEmpty(sql))//<2F> <> <EFBFBD> Ի<EFBFBD> <D4BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> sql<71> <6C> <EFBFBD> <EFBFBD>
//{
// DataBaseLinkEntity dataBaseLinkEntity = dataBaseLinkService.GetEntity(dbbaseId);//<2F> <> ȡ
// this.BaseRepository(dataBaseLinkEntity.DbConnection).ExecuteBySql(sql.Replace("{0}", processInstanceEntity.Id));
//}
UnitWork . Save ( ) ;
return 1 ;
}
catch
{
throw ;
}
}
#endregion
#region <EFBFBD> <EFBFBD> <EFBFBD> ̴ <EFBFBD> <EFBFBD> <EFBFBD> API
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> ʵ<EFBFBD> <CAB5>
@@ -166,153 +88,142 @@ namespace OpenAuth.App
/// <summary>
/// <20> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD>
/// </summary>
/// <param name="process Id"></param>
/// <param name="instance Id"></param>
/// <returns></returns>
public bool NodeVerification ( string process Id, bool flag , string description = "" )
public bool NodeVerification ( string instance Id, bool flag , string description = "" )
{
bool _res = false ;
try
FlowInstance flowInstance = Get ( instanceId ) ;
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory ( ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼
FlowInstanceTransitionHistory processTransitionHistoryEntity = null ; //<2F> <> ת<EFBFBD> <D7AA> ¼
FlowRuntime wfruntime = new FlowRuntime ( flowInstance ) ;
#region <EFBFBD> <EFBFBD> ǩ
if ( flowInstance . ActivityType = = 0 ) //<2F> <> ǩ
{
string _sqlstr = "" , _dbbaseId = "" ;
FlowInstance FlowInstance = Get ( processId ) ;
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory ( ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼
FlowInstanceTransitionHistory processTransitionHistoryEntity = null ; //<2F> <> ת<EFBFBD> <D7AA> ¼
FlowRuntime wfruntime = new FlowRuntime ( FlowInstance ) ;
#region <EFBFBD> <EFBFBD> ǩ
if ( FlowInstance . ActivityType = = 0 ) //<2F> <> ǩ
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , 1 , "" ) ;//<2F> <> <EFBFBD> ǵ<EFBFBD> ǰ<EFBFBD> ڵ<EFBFBD> ͨ<EFBFBD> <CDA8>
///Ѱ<> <D1B0> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> ˵Ľڵ<C4BD> Id
string _VerificationNodeId = "" ;
List < string > _nodelist = wfruntime . GetCountersigningNodeIdList ( wfruntime . runtimeModel . currentNodeId ) ;
string _makerList = "" ;
foreach ( string item in _nodelist )
{
wfruntime . MakeTagN ode( wfruntime . runtimeModel . currentNodeId , 1 , "" ) ; //<2F> <> <EFBFBD> ǵ<EFBFBD> ǰ<EFBFBD> ڵ<EFBFBD> ͨ<EFBFBD> <CDA8>
///Ѱ<> <D1B0> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> ˵Ľڵ<C4BD> Id
string _VerificationNodeId = "" ;
List < string > _nodelist = wfruntime . GetCountersigningNodeIdList ( wfruntime . runtimeModel . currentNodeId ) ;
string _makerList = "" ;
foreach ( string item in _nodelist )
_makerList = GetMakerList ( wfruntime . runtimeModel . n odes [ item ] , wfruntime. runtimeModel . flowInstanceId ) ;
if ( _makerList ! = "-1" )
{
_makerList = GetMakerList ( wfruntime . runtimeModel . nodes [ item ] , wfruntime . runtimeModel . flowInstanceId ) ;
if ( _makerList ! = "-1" )
var id = AuthUtil . GetCurrentUser ( ) . User . Id ;
foreach ( string one in _makerList . Split ( ',' ) )
{
var id = AuthUtil . GetCurrentUser ( ) . User . Id ;
foreach ( string one in _makerList . Split ( ',' ) )
if ( id = = one | | id . IndexOf ( one ) ! = - 1 )
{
if ( id = = one | | id . IndexOf ( one ) ! = - 1 )
{
_VerificationNodeId = item ;
break ;
}
_VerificationNodeId = item ;
break ;
}
}
}
if ( _VerificationNodeId ! = "" )
{
if ( flag )
{
FlowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . nodes [ _VerificationNodeId ] . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
else
{
FlowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . nodes [ _VerificationNodeId ] . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
string _Confluenceres = wfruntime . NodeConfluence ( _VerificationNodeId , flag , AuthUtil . GetCurrentUser ( ) . User . Id , description ) ;
var _data = new
{
SchemeContent = wfruntime . runtimeModel . schemeContentJson . ToString ( ) ,
wfruntime . runtimeModel . frmData
} ;
switch ( _Confluenceres )
{
case "-1" : //<2F> <> ͨ<EFBFBD> <CDA8>
FlowInstance . IsFinish = 3 ;
break ;
case "1" : //<2F> ȴ<EFBFBD>
break ;
default : //ͨ<> <CDA8>
FlowInstance . PreviousId = FlowInstance . ActivityId ;
FlowInstance . ActivityId = wfruntime . runtimeModel . nextNodeId ;
FlowInstance . ActivityType = wfruntime . runtimeModel . nextNodeType ; //-1<> <EFBFBD> <DEB7> <EFBFBD> <EFBFBD> <EFBFBD> ,0<> <30> ǩ<EFBFBD> <C7A9> ʼ ,1<> <31> ǩ<EFBFBD> <C7A9> <EFBFBD> <EFBFBD> ,2һ <32> <D2BB> <EFBFBD> ڵ<EFBFBD> ,4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
FlowInstance . ActivityName = wfruntime . runtimeModel . nextNode . name ;
FlowInstance . IsFinish = ( wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ) ;
FlowInstance . MakerList = ( wfruntime . runtimeModel . nextNodeType = = 4 ? "" : GetMakerList ( wfruntime ) ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstanceTransitionHistory ( ) ;
processTransitionHistoryEntity . FromNodeId = wfruntime . runtimeModel . currentNodeId ;
processTransitionHistoryEntity . FromNodeName = wfruntime . runtimeModel . currentNode . name ;
processTransitionHistoryEntity . FromNodeType = wfruntime . runtimeModel . currentNodeType ;
processTransitionHistoryEntity . ToNodeId = wfruntime . runtimeModel . nextNodeId ;
processTransitionHistoryEntity . ToNodeName = wfruntime . runtimeModel . nextNode . name ;
processTransitionHistoryEntity . ToNodeType = wfruntime . runtimeModel . nextNodeType ;
processTransitionHistoryEntity . TransitionSate = 0 ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
break ;
}
}
else
{
throw ( new Exception ( "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> 쳣,<2C> Ҳ<EFBFBD> <D2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˽ڵ<CBBD> " ) ) ;
}
}
#endregion
#region һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
else //һ <> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( _VerificationNodeId ! = "" )
{
if ( flag )
{
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , 1 , AuthUtil . GetCurrentUser ( ) . User . Id , description ) ;
FlowInstance . PreviousId = FlowInstance . ActivityId ;
FlowInstance . ActivityId = wfruntime . runtimeModel . nextNodeId ;
FlowInstance . ActivityType = wfruntime . runtimeModel . nextNodeType ; //-1<> <EFBFBD> <DEB7> <EFBFBD> <EFBFBD> <EFBFBD> ,0<> <30> ǩ<EFBFBD> <C7A9> ʼ ,1<> <31> ǩ<EFBFBD> <C7A9> <EFBFBD> <EFBFBD> ,2һ <32> <D2BB> <EFBFBD> ڵ<EFBFBD> ,4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
FlowInstance . ActivityName = wfruntime . runtimeModel . nextNode . name ;
FlowInstance . MakerList = wfruntime . runtimeModel . nextNodeType = = 4 ? "" : GetMakerList ( wfruntime ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
FlowInstance . IsFinish = ( wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ) ;
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
{
FromNodeId = wfruntime . runtimeModel . currentNodeId ,
FromNodeName = wfruntime . runtimeModel . currentNode . name ,
FromNodeType = wfruntime . runtimeModel . currentNodeType ,
ToNodeId = wfruntime . runtimeModel . nextNodeId ,
ToNodeName = wfruntime . runtimeModel . nextNode . name ,
ToNodeType = wfruntime . runtimeModel . nextNodeType ,
TransitionSate = 0
} ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
FlowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . nodes [ _VerificationNodeId ] . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
else
{
F lowInstance. IsFinish = 3 ; //<2F> <> ʾ <EFBFBD> ýڵ㲻ͬ<E3B2BB> <CDAC>
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , - 1 , AuthUtil . GetUserName ( ) , description ) ;
FlowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
f lowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . nodes [ _VerificationNodeId ] . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
var data = new
string _Confluenceres = wfruntime . NodeConfluence ( _VerificationNodeId , flag , AuthUtil . GetCurrentUser ( ) . User . Id , description ) ;
var _data = new
{
SchemeContent = wfruntime . runtimeModel . schemeContentJson . ToString ( ) ,
wfruntime . runtimeModel . frmData
} ;
}
#endregion
switch ( _Confluenceres )
{
case "-1" : //<2F> <> ͨ<EFBFBD> <CDA8>
flowInstance . IsFinish = 3 ;
break ;
case "1" : //<2F> ȴ<EFBFBD>
break ;
default : //ͨ<> <CDA8>
flowInstance . PreviousId = flowInstance . ActivityId ;
flowInstance . ActivityId = wfruntime . runtimeModel . nextNodeId ;
flowInstance . ActivityType = wfruntime . runtimeModel . nextNodeType ; //-1<> <EFBFBD> <DEB7> <EFBFBD> <EFBFBD> <EFBFBD> ,0<> <30> ǩ<EFBFBD> <C7A9> ʼ ,1<> <31> ǩ<EFBFBD> <C7A9> <EFBFBD> <EFBFBD> ,2һ <32> <D2BB> <EFBFBD> ڵ<EFBFBD> ,4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
flowInstance . ActivityName = wfruntime . runtimeModel . nextNode . name ;
flowInstance . IsFinish = ( wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ) ;
flowInstance . MakerList = ( wfruntime . runtimeModel . nextNodeType = = 4 ? "" : GetMakerList ( wfruntime ) ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
_res = true ;
SaveProcess ( _sqlstr , _dbbaseId , FlowInstance , FlowInstanceOperationHistory , process TransitionHistoryEntity ) ;
return _res ;
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstance TransitionHistory( ) ;
processTransitionHistoryEntity . FromNodeId = wfruntime . runtimeModel . currentNodeId ;
processTransitionHistoryEntity . FromNodeName = wfruntime . runtimeModel . currentNode . name ;
processTransitionHistoryEntity . FromNodeType = wfruntime . runtimeModel . currentNodeType ;
processTransitionHistoryEntity . ToNodeId = wfruntime . runtimeModel . nextNodeId ;
processTransitionHistoryEntity . ToNodeName = wfruntime . runtimeModel . nextNode . name ;
processTransitionHistoryEntity . ToNodeType = wfruntime . runtimeModel . nextNodeType ;
processTransitionHistoryEntity . TransitionSate = 0 ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
break ;
}
}
else
{
throw ( new Exception ( "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> 쳣,<2C> Ҳ<EFBFBD> <D2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˽ڵ<CBBD> " ) ) ;
}
}
catch
#endregion
#region һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
else //һ <> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
throw ;
if ( flag )
{
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , 1
, AuthUtil . GetCurrentUser ( ) . User . Id , description ) ;
flowInstance . PreviousId = flowInstance . ActivityId ;
flowInstance . ActivityId = wfruntime . runtimeModel . nextNodeId ;
flowInstance . ActivityType = wfruntime . runtimeModel . nextNodeType ;
flowInstance . ActivityName = wfruntime . runtimeModel . nextNode . name ;
flowInstance . MakerList = wfruntime . runtimeModel . nextNodeType = = 4 ? "" : GetMakerList ( wfruntime ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
flowInstance . IsFinish = ( wfruntime . runtimeModel . nextNodeType = = 4 ? 1 : 0 ) ;
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstanceTransitionHistory
{
FromNodeId = wfruntime . runtimeModel . currentNodeId ,
FromNodeName = wfruntime . runtimeModel . currentNode . name ,
FromNodeType = wfruntime . runtimeModel . currentNodeType ,
ToNodeId = wfruntime . runtimeModel . nextNodeId ,
ToNodeName = wfruntime . runtimeModel . nextNode . name ,
ToNodeType = wfruntime . runtimeModel . nextNodeType ,
TransitionSate = 0
} ;
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
else
{
flowInstance . IsFinish = 3 ; //<2F> <> ʾ <EFBFBD> ýڵ㲻ͬ<E3B2BB> <CDAC>
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , - 1 , AuthUtil . GetUserName ( ) , description ) ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
}
}
#endregion
UnitWork . Update ( flowInstance ) ;
UnitWork . Add ( flowInstanceOperationHistory ) ;
UnitWork . Add ( processTransitionHistoryEntity ) ;
UnitWork . Save ( ) ;
return true ;
}
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD>
@@ -323,59 +234,56 @@ namespace OpenAuth.App
/// <returns></returns>
public bool NodeReject ( string processId , string nodeId , string description = "" )
{
try
FlowInstance flowInstance = Get ( processId ) ;
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory ( ) ;
FlowInstanceTransitionHistory processTransitionHistoryEntity = null ;
FlowRuntime wfruntime = new FlowRuntime ( flowInstance ) ;
string resnode = "" ;
if ( nodeId = = "" )
{
FlowInstance flowInstance = Get ( processId ) ;
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory ( ) ;
FlowInstanceTransitionHistory processTransitionHistoryEntity = null ;
FlowRuntime wfruntime = new FlowRuntime ( flowInstance ) ;
string resnode = "" ;
if ( nodeId = = "" )
{
resnode = wfruntime . RejectNode ( ) ;
}
else
{
resnode = nodeId ;
}
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , 0 , AuthUtil . GetUserName ( ) , description ) ;
flowInstance . IsFinish = 4 ; //4<> <34> ʾ <EFBFBD> <CABE> <EFBFBD> أ<EFBFBD> <D8A3> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ύ<EFBFBD> <E1BDBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( resnode ! = "" )
{
flowInstance . PreviousId = flowInstance . ActivityId ;
flowInstance . ActivityId = resnode ;
flowInstance . ActivityType = wfruntime . GetNodeType ( resnode ) ; //-1<> <EFBFBD> <DEB7> <EFBFBD> <EFBFBD> <EFBFBD> ,0<> <30> ǩ<EFBFBD> <C7A9> ʼ ,1<> <31> ǩ<EFBFBD> <C7A9> <EFBFBD> <EFBFBD> ,2һ <32> <D2BB> <EFBFBD> ڵ<EFBFBD> ,4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
flowInstance . ActivityName = wfruntime . runtimeModel . nodes [ resnode ] . name ;
flowInstance . MakerList = GetMakerList ( wfruntime . runtimeModel . nodes [ resnode ] , flowInstance . PreviousId ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstanceTransitionHistory ( ) ;
processTransitionHistoryEntity . FromNodeId = wfruntime . runtimeModel . currentNodeId ;
processTransitionHistoryEntity . FromNodeName = wfruntime . runtimeModel . currentNode . name ;
processTransitionHistoryEntity . FromNodeType = wfruntime . runtimeModel . currentNodeType ;
processTransitionHistoryEntity . ToNodeId = wfruntime . runtimeModel . nextNodeId ;
processTransitionHistoryEntity . ToNodeName = wfruntime . runtimeModel . nextNode . name ;
processTransitionHistoryEntity . ToNodeType = wfruntime . runtimeModel . nextNodeType ;
processTransitionHistoryEntity . TransitionSate = 1 ; //
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
}
var data = new
{
SchemeContent = wfruntime . runtimeModel . schemeContentJson . ToString ( ) ,
frmData = ( flowInstance . FrmType = = 0 ? wfruntime . runtimeModel . frmData : null )
} ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
SaveProcess ( flowInstance , flowInstanceOperationHistory , processTransitionHistoryEntity ) ;
return true ;
resnode = wfruntime . RejectNode ( ) ;
}
catch
else
{
throw ;
resnode = nodeId ;
}
wfruntime . MakeTagNode ( wfruntime . runtimeModel . currentNodeId , 0 , AuthUtil . GetUserName ( ) , description ) ;
flowInstance . IsFinish = 4 ; //4<> <34> ʾ <EFBFBD> <CABE> <EFBFBD> أ<EFBFBD> <D8A3> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ύ<EFBFBD> <E1BDBB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( resnode ! = "" )
{
flowInstance . PreviousId = flowInstance . ActivityId ;
flowInstance . ActivityId = resnode ;
flowInstance . ActivityType = wfruntime . GetNodeType ( resnode ) ; //-1<> <EFBFBD> <DEB7> <EFBFBD> <EFBFBD> <EFBFBD> ,0<> <30> ǩ<EFBFBD> <C7A9> ʼ ,1<> <31> ǩ<EFBFBD> <C7A9> <EFBFBD> <EFBFBD> ,2һ <32> <D2BB> <EFBFBD> ڵ<EFBFBD> ,4<> <34> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> н<EFBFBD> <D0BD> <EFBFBD>
flowInstance . ActivityName = wfruntime . runtimeModel . nodes [ resnode ] . name ;
flowInstance . MakerList = GetMakerList ( wfruntime . runtimeModel . nodes [ resnode ] , flowInstance . PreviousId ) ; //<2F> <> ǰ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ִ<EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ
#region <EFBFBD> <EFBFBD> ת <EFBFBD> <EFBFBD> ¼
processTransitionHistoryEntity = new FlowInstanceTransitionHistory ( ) ;
processTransitionHistoryEntity . FromNodeId = wfruntime . runtimeModel . currentNodeId ;
processTransitionHistoryEntity . FromNodeName = wfruntime . runtimeModel . currentNode . name ;
processTransitionHistoryEntity . FromNodeType = wfruntime . runtimeModel . currentNodeType ;
processTransitionHistoryEntity . ToNodeId = wfruntime . runtimeModel . nextNodeId ;
processTransitionHistoryEntity . ToNodeName = wfruntime . runtimeModel . nextNode . name ;
processTransitionHistoryEntity . ToNodeType = wfruntime . runtimeModel . nextNodeType ;
processTransitionHistoryEntity . TransitionSate = 1 ; //
processTransitionHistoryEntity . IsFinish = ( processTransitionHistoryEntity . ToNodeType = = 4 ? 1 : 0 ) ;
#endregion
}
var data = new
{
SchemeContent = wfruntime . runtimeModel . schemeContentJson . ToString ( ) ,
frmData = ( flowInstance . FrmType = = 0 ? wfruntime . runtimeModel . frmData : null )
} ;
flowInstanceOperationHistory . Content = "<22> <> " + "todo name" + "<22> <> <EFBFBD> <EFBFBD> " + wfruntime . runtimeModel . currentNode . name + "<22> <> <EFBFBD> <EFBFBD> " + DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) + "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> ע<EFBFBD> <D7A2> " + description ;
UnitWork . Add ( flowInstance ) ;
UnitWork . Add ( flowInstanceOperationHistory ) ;
UnitWork . Add ( processTransitionHistoryEntity ) ;
UnitWork . Save ( ) ;
return true ;
}
#endregion
@@ -454,10 +362,10 @@ namespace OpenAuth.App
//}
//else if (node.setInfo.NodeDesignate.Value == "NodeDesignateType2")//ָ<> <D6B8> <EFBFBD> <EFBFBD> Ա
//{
makerlsit = ArrayToString ( node . setInfo . NodeDesignateData . role , makerlsit ) ;
makerlsit = GenericHelpers . ArrayToString( node . setInfo . NodeDesignateData . role , makerlsit ) ;
// makerlsit = ArrwyToString(node.setInfo.NodeDesignateData.post, makerlsit);
// makerlsit = ArrwyToString(node.setInfo.NodeDesignateData.usergroup, makerlsit);
makerlsit = ArrayToString ( node . setInfo . NodeDesignateData . users , makerlsit ) ;
makerlsit = GenericHelpers . ArrayToString( node . setInfo . NodeDesignateData . users , makerlsit ) ;
if ( makerlsit = = "" )
{
@@ -531,68 +439,33 @@ namespace OpenAuth.App
/// <param name="data"></param>
/// <param name="Str"></param>
/// <returns></returns>
private string ArrayToString ( dynamic data , string Str )
{
string resStr = Str ;
foreach ( var item in data )
{
if ( resStr ! = "" )
{
resStr + = "," ;
}
if ( item is string )
{
resStr + = item ;
}
else
{
resStr + = item . Value ;
}
}
return resStr ;
}
/// <summary>
/// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
/// <para><3E> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2017-01-20 15:44:45</para>
/// </summary>
/// <param name="processId">The process identifier.</param>
/// <param name="verificationData">The verification data.</param>
public void VerificationProcess ( string processId , string verificationData )
public void Verification ( VerificationReq request )
{
try
//<2F> <> <EFBFBD> <EFBFBD>
if ( request . VerificationFinally = = "3" )
{
dynamic verificationDataJson = verificationData . ToJson ( ) ;
//<2F> <> <EFBFBD> <EFBFBD>
if ( verificationDataJson . VerificationFinally . Value = = "3" )
string _nodeId = "" ;
if ( ! string . IsNullOrEmpty ( request . NodeRejectStep ) )
{
string _nodeId = "" ;
if ( verificationDataJson . NodeRejectStep ! = null )
{
_nodeId = verificationDataJson . NodeRejectStep . Value ;
}
NodeReject ( processId , _nodeId , verificationDataJson . VerificationOpinion . Value ) ;
}
else if ( verificationDataJson . VerificationFinally . Value = = "2" ) //<2F> <> ʾ <EFBFBD> <CABE> ͬ<EFBFBD> <CDAC>
{
NodeVerification ( processId , false , verificationDataJson . VerificationOpinion . Value ) ;
}
else if ( verificationDataJson . VerificationFinally . Value = = "1" ) //<2F> <> ʾ ͬ<CABE> <CDAC>
{
NodeVerification ( processId , true , verificationDataJson . VerificationOpinion . Value ) ;
_nodeId = request . NodeRejectStep ;
}
NodeReject ( request . FlowInstanceId , _nodeId , request . VerificationOpinion ) ;
}
catch
else if ( request . VerificationFinally = = "2" ) //<2F> <> ʾ <EFBFBD> <CABE> ͬ<EFBFBD> <CDAC>
{
throw ;
NodeVerification ( request . FlowInstanceId , false , request . VerificationOpinion ) ;
}
else if ( request . VerificationFinally = = "1" ) //<2F> <> ʾ ͬ<CABE> <CDAC>
{
NodeVerification ( request . FlowInstanceId , true , request . VerificationOpinion ) ;
}
}
public void Update ( FlowInstance flowScheme )
{
Repository . Update ( u = > u . Id = = flowScheme . Id , u = > new FlowInstance ( ) ) ;