//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { EnsureUtil.ensureNotNull("user transaction", utx); // simulate a failure that triggers the transaction rollback utx.setRollbackOnly(); }
public virtual void notify(DelegateTask delegateTask) { DelegateExecution execution = delegateTask.Execution; string newKeyValue = (string)execution.getVariable(BUSINESS_KEY_VARIABLE); execution.ProcessBusinessKey = newKeyValue; }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { ProcessEngineServices processEngineServices = execution.ProcessEngineServices; RuntimeService runtimeService = processEngineServices.RuntimeService; runtimeService.getActivityInstance(execution.ProcessInstanceId); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { int? executionsBeforeError = (int?)execution.getVariable("executionsBeforeError"); int? executions = (int?)execution.getVariable("executions"); bool?exceptionType = (bool?)execution.getVariable("exceptionType"); if (executions == null) { executions = 0; } executions++; if (executionsBeforeError == null || executionsBeforeError < executions) { if (exceptionType != null && exceptionType) { throw new MyBusinessException("This is a business exception, which can be caught by a BPMN Error Event."); } else { throw new BpmnError("23", "This is a business fault, which can be caught by a BPMN Error Event."); } } else { execution.setVariable("executions", executions); } }
public virtual string assignTask(DelegateExecution execution) { logAuthentication(execution); logInstancesCount(execution); return("demo"); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { ProcessEngineServices services = execution.ProcessEngineServices; RuntimeService runtimeService = services.RuntimeService; runtimeService.setVariable(execution.Id, "serviceTaskCalled", true); }
public virtual void execute(DelegateExecution execution) { string var = (string)execution.getVariable(VARIABLE_NAME); var = var.ToUpper(); execution.setVariable(VARIABLE_NAME, var); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { JavaSerializable dataObject = (JavaSerializable)execution.getVariable("varName"); Assert.assertNotNull(dataObject); Assert.assertEquals("foo", dataObject.Property); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { Task task = execution.ProcessEngineServices.TaskService.createTaskQuery().taskName(TASK_WITH_CONDITION).singleResult(); ((TaskEntity)task).getExecution().setVariableLocal(VARIABLE_NAME, 1); execution.setVariableLocal(VARIABLE_NAME + 1, 1); }
public virtual void notify(DelegateTask delegateTask) { DelegateExecution execution = delegateTask.Execution; execution.setVariable("varName", "varValue", "activityId"); assertThat(execution.getVariableLocal("varName"), @is(notNullValue())); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { SerializableVariable serializableVariable = new SerializableVariable(); serializableVariable.Value = "camunda BPM"; execution.setVariable("var1", serializableVariable); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { // first set variable to some string execution.setVariable("variableName", "test"); // now set to serializable execution.setVariable("variableName", new SerializableVariable("foo")); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { // we assert that the entity manager contains the entity // this means that we obtain the same entity manager we used to // persist the entity before starting the process Assert.assertTrue(em.contains(entity)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager); transactionTemplate.PropagationBehavior = TransactionTemplate.PROPAGATION_REQUIRED; transactionTemplate.execute(new TransactionCallbackAnonymousInnerClass(this)); }
public virtual bool evaluate(VariableScope scope, DelegateExecution execution) { object result = expression.getValue(scope, execution); ensureNotNull("condition expression returns null", "result", result); ensureInstanceOf("condition expression returns non-Boolean", "result", result, typeof(Boolean)); return((bool?)result.Value); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { // we assert that the entity manager does not contain the entity // this means that we obtain a seperate entity manager since // we are invoked in a new transaction Assert.assertFalse(em.contains(entity)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { execution.setVariable("myVar", sentenceGenerator.Sentence); if (someField != null) { execution.setVariable("fieldInjection", someField.getValue(execution)); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void notify(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void notify(DelegateExecution execution) { execution.setVariable("executionListenerVar", "working"); if (someField != null) { execution.setVariable("executionListenerField", someField.getValue(execution)); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { RepositoryService repoService = execution.ProcessEngineServices.RepositoryService; ProcessDefinition targetDefinition = repoService.createProcessDefinitionQuery().latestVersion().singleResult(); SetProcessDefinitionVersionCmd migrationCommand = new SetProcessDefinitionVersionCmd(execution.ProcessInstanceId, targetDefinition.Version); Context.ProcessEngineConfiguration.CommandExecutorTxRequired.execute(migrationCommand); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { bool?fail = (bool?)execution.getVariable("fail"); if (fail != null && fail) { throw new ProcessEngineException("Exception expected."); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void notify(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void notify(DelegateExecution execution) { PerfTestRunContext perfTestRunContext = org.camunda.bpm.qa.performance.engine.framework.PerfTestRunContext_Fields.currentContext.get(); if (perfTestRunContext != null) { perfTestRunContext.setVariable(EXECUTION_ID, execution.Id); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { object shouldThrowError = execution.getVariable("shouldThrowError"); if (shouldThrowError != null) { throw new BpmnError("error"); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { this.statefulObject.increment(); Assert.assertNotNull("the 'scopedCustomer' reference can't be null", this.statefulObject); Assert.assertNotNull("the 'scopedCustomer.name' property should be non-null, since it was set in a previous delegate bound to this very thread", this.statefulObject.Name); //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: log.info("the 'uuid' value retrieved from the ScopedCustomer#name property is '" + this.statefulObject.Name + "' in " + this.GetType().FullName); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { bool?fail = (bool?)execution.getVariable("secondFail"); if (fail == null || fail == true) { throw new ProcessEngineException(SECOND_EXCEPTION_MESSAGE); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void notify(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void notify(DelegateExecution execution) { int?counter = (int?)execution.getVariable("executionListenerCounter"); if (counter == null) { counter = 0; } execution.setVariable("subExecutionListenerCounter", ++counter); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { bool expressionWasExecuted = (bool?)execution.getVariable("expressionWasExecuted").Value; bool delegateExpressionWasExecuted = (bool?)execution.getVariable("delegateExpressionWasExecuted").Value; bool wasExecuted = (bool?)execution.getVariable("wasExecuted").Value; this.expressionWasExecuted = expressionWasExecuted; this.delegateExpressionWasExecuted = delegateExpressionWasExecuted; this.wasExecuted = wasExecuted; }
public virtual void execute(DelegateExecution execution) { execution.setVariable("jsonVariable", Variables.untypedValue(jsonValue("{}"), true)); // when TypedValue typedValue = execution.getVariableTyped("jsonVariable"); // then assertThat(typedValue.Transient, @is(true)); }
protected internal override HistoryEvent createHistoryEvent(DelegateExecution execution) { if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_END, execution)) { return(eventProducer.createProcessInstanceEndEvt(execution)); } else { return(null); } }
protected internal override HistoryEvent createHistoryEvent(DelegateExecution execution) { if (historyLevel.isHistoryEventProduced(HistoryEventTypes.ACTIVITY_INSTANCE_START, execution)) { return(eventProducer.createActivityInstanceStartEvt(execution)); } else { return(null); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: @Override public void execute(org.camunda.bpm.engine.delegate.DelegateExecution execution) throws Exception public virtual void execute(DelegateExecution execution) { if (instanceCount < 3) { execution.setVariable(AbstractConditionalEventTestCase.VARIABLE_NAME, 1); } else { execution.setVariable(AbstractConditionalEventTestCase.VARIABLE_NAME, instanceCount); } }