public void StartProcessTest() { IProcessInstance processInstance = null; Thread.CurrentPrincipal = new PrincipalUserAdapter("ae"); try { IDictionary attributeValues = new Hashtable(); //attributeValues["available"] = "APPROVE"; //attributeValues["product"] = "abcd"; //attributeValues["requester"] = "efg"; IProcessDefinition booaction = definitionComponent.GetProcessDefinition("Hello world 4"); processInstance = executionComponent.StartProcessInstance(booaction.Id, attributeValues); Assert.IsNotNull(processInstance); } catch (ExecutionException e) { Assert.Fail("ExcecutionException while starting a new holiday request: " + e.Message); } finally { // loginUtil.logout(); } }
public void TestActionHandlerVersioning() { //This test tests the versioning of Assemblies. //The version 1 Actionhandler always approves and version 2 always disapproves. DeployParFile("versiontestV1.par"); IProcessDefinition definitionV1 = definitionComponent.GetProcessDefinition("ActionHandlerVersionTest"); // perform the first activity IProcessInstance processInstanceV1 = executionComponent.StartProcessInstance(definitionV1.Id); Assert.IsNotNull(processInstanceV1); Assert.IsTrue(processInstanceV1.RootFlow.Node.Name.Equals("isAvailable")); DeployParFile("versiontestV2.par"); IProcessDefinition definitionV2 = definitionComponent.GetProcessDefinition("ActionHandlerVersionTest"); // perform the first activity IProcessInstance processInstanceV2 = executionComponent.StartProcessInstance(definitionV2.Id); Assert.IsNotNull(processInstanceV1); Assert.IsTrue(processInstanceV2.RootFlow.Node.Name.Equals("notAvailable")); }