Example #1
0
        private static WfActivityDescriptor PrepareServerActivity(string key)
        {
            WfActivityDescriptor actDesp = new WfActivityDescriptor(key, WfActivityType.InitialActivity);

            actDesp.Key  = key;
            actDesp.Name = key;

            actDesp.Condition.Expression = "Amount > 1000";
            actDesp.Variables.SetValue("ActKey", key);
            actDesp.Variables.SetValue("ActName", key);

            actDesp.Resources.Add(new WfUserResourceDescriptor((IUser)OguUser.CreateWrapperObject(ActivityConverterTest.UserID, SchemaType.Users)));
            actDesp.Resources.Add(new WfDepartmentResourceDescriptor((IOrganization)OguOrganization.CreateWrapperObject(ActivityConverterTest.OrganizationID, SchemaType.Organizations)));
            actDesp.Resources.Add(new WfGroupResourceDescriptor((IGroup)OguGroup.CreateWrapperObject(ActivityConverterTest.GroupID, SchemaType.Groups)));
            actDesp.Resources.Add(new WfRoleResourceDescriptor(new SOARole(ActivityConverterTest.RoleFullCodeName)));
            actDesp.Resources.Add(new WfActivityOperatorResourceDescriptor()
            {
                ActivityKey = ActivityConverterTest.ResActivityKey
            });
            actDesp.Resources.Add(new WfActivityAssigneesResourceDescriptor()
            {
                ActivityKey = ActivityConverterTest.ResActivityKey
            });
            actDesp.Resources.Add(new WfDynamicResourceDescriptor("ConditionResource", "Amount > 1000"));
            actDesp.BranchProcessTemplates.Add(BranchProcessTemplateConverterTest.PrepareServerBranchProcessTemplate());

            return(actDesp);
        }
Example #2
0
        private static WfClientTransferParams PrepareClientTransferParams()
        {
            WfClientTransferParams transferParams = new WfClientTransferParams("N1");

            transferParams.Operator = Consts.Users["Requestor"];
            transferParams.FromTransitionDescriptorKey = "L1";
            transferParams.Assignees.Add(Consts.Users["Approver1"]);

            WfClientBranchProcessTemplateDescriptor template             = BranchProcessTemplateConverterTest.PrepareClientBranchProcessTemplate();
            WfClientBranchProcessTransferParams     branchTransferParams = new WfClientBranchProcessTransferParams(template);

            WfClientBranchProcessStartupParams branchStartupParams = new WfClientBranchProcessStartupParams(Consts.Users["CFO"]);

            branchStartupParams.DefaultTaskTitle = "Hello Branch";
            branchStartupParams.Department       = Consts.Departments["RequestorOrg"];
            branchStartupParams.ApplicationRuntimeParameters["Amount"] = 1024;
            branchStartupParams.ResourceID                 = UuidHelper.NewUuidString();
            branchStartupParams.StartupContext             = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            branchStartupParams.RelativeParams["Relative"] = "Hello world";

            branchTransferParams.BranchParams.Add(branchStartupParams);

            transferParams.BranchTransferParams.Add(branchTransferParams);

            return(transferParams);
        }
Example #3
0
        private static WfClientActivityDescriptor PrepareClientActivity(string key)
        {
            WfClientActivityDescriptor actDesp = new WfClientActivityDescriptor(WfClientActivityType.InitialActivity);

            actDesp.Key  = key;
            actDesp.Name = key;

            actDesp.Condition.Expression = "Amount > 1000";
            actDesp.Variables.AddOrSetValue("ActKey", key);
            actDesp.Variables.AddOrSetValue("ActName", key);

            actDesp.Resources.Add(new WfClientUserResourceDescriptor(new WfClientUser(ActivityConverterTest.UserID)));
            actDesp.Resources.Add(new WfClientDepartmentResourceDescriptor(new WfClientOrganization(ActivityConverterTest.OrganizationID)));
            actDesp.Resources.Add(new WfClientGroupResourceDescriptor(new WfClientGroup(ActivityConverterTest.GroupID)));
            actDesp.Resources.Add(new WfClientRoleResourceDescriptor(ActivityConverterTest.RoleFullCodeName));
            actDesp.Resources.Add(new WfClientActivityOperatorResourceDescriptor(ActivityConverterTest.ResActivityKey));
            actDesp.Resources.Add(new WfClientActivityAssigneesResourceDescriptor(ActivityConverterTest.ResActivityKey));
            actDesp.Resources.Add(new WfClientDynamicResourceDescriptor("ConditionResource", "Amount > 1000"));
            actDesp.BranchProcessTemplates.Add(BranchProcessTemplateConverterTest.PrepareClientBranchProcessTemplate());

            return(actDesp);
        }