public void Jump(string origin, string destination, String instanceID, WorkflowProcess process, IWorkflowPersistent <WorkflowProcess, Action <Object> > processService)
        {
            IList <Action <ISession> > commands = new List <Action <ISession> >
            {
                (session) =>
                session
                .CreateQuery("delete from WorkflowLink c where c.RelationshipID=:RelationshipID and c.InstanceID=:InstanceID")
                .SetParameter("RelationshipID", origin)
                .SetParameter("InstanceID", instanceID)
                .ExecuteUpdate(),
                (session) => session.Persist(new WorkflowLink {
                    InstanceID = instanceID, RelationshipID = destination
                }),
                (session) => processService.Persistent(process, (entry) => session.Persist(entry))
            };

            DbFactory.Execute(DbFactory.OpenSession(), commands);
        }
        /// <summary>
        /// 获取回退线路
        /// </summary>
        /// <returns>路线</returns>
        protected Transition GetHistoryTransition(Node entry)
        {
            Transition transition = null;

            Dictionary <String, Object> queryArg = new Dictionary <string, object>
            {
                { "InstanceID", entry.InstanceID },
                { "Direction", (int)WorkflowOpertaion.Go }
            };

            WorkflowProcess process = ProcessService
                                      .Query(queryArg).Where(c => c.Destination == entry.ID)
                                      .FirstOrDefault();

            if (process != null && entry.NodeType != WorkflowNodeCategory.Start)
            {
                transition = TransitionService.Query(entry.InstanceID).FirstOrDefault(e => e.NID == process.TransitionID);
            }

            return(transition);
        }
Example #3
0
 public void Persistent(WorkflowProcess process, Action <object> callback)
 {
     callback(process);
 }