Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-1689

I can create / resolve an incident through public API

    Details

    • Type: Feature Request
    • Status: Closed
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.8.0, 7.8.0-alpha2
    • Component/s: engine
    • Labels:
      None

      Description

      It should be possible to create and resolve incidents through public API.

      AT:

      • RuntimeService API
        runtimeService.createIncident(String incidentType, String executionId, String activityId, String configuration)
        runtimeService.resolveIncident(String incidentId)
        
      • DelegateExecution
        execution.createIncident(String incidentType, String configuration)
        execution.resolveIncident(String incidentId)
        
      • REST api enhancements
        • I can create resolve / incidents through REST api as well.

        Issue Links

          Activity

          Hide
          StephenOTT Stephen Russett added a comment -

          +1

          Show
          StephenOTT Stephen Russett added a comment - +1
          Hide
          StephenOTT Stephen Russett added a comment -
          function Incidents(){};
          Incidents.prototype.createIncident = function(incidentType, incidentMessage) {
          
            var IncidentEntity  = Java.type('org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity');
            var IncidentContext = Java.type('org.camunda.bpm.engine.impl.incident.IncidentContext');
          
            var context = new IncidentContext();
            context.setActivityId(execution.getCurrentActivityId());
            context.setExecutionId(execution.getProcessInstanceId());
            context.setProcessDefinitionId(execution.getProcessDefinitionId());
          
            var newIncident  = IncidentEntity.createAndInsertIncident(incidentType, context, incidentMessage);
          
            return newIncident;
          };
           
          Incidents.prototype.resolveIncident = function(incidentId){
          
              execution.getProcessEngineServices()
                       .getRuntimeService()
                       .createIncidentQuery()
                       .incidentId(incidentId)
                       .singleResult()
                       .resolve();
          }
          
          Show
          StephenOTT Stephen Russett added a comment - function Incidents(){}; Incidents.prototype.createIncident = function(incidentType, incidentMessage) { var IncidentEntity = Java.type('org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity'); var IncidentContext = Java.type('org.camunda.bpm.engine.impl.incident.IncidentContext'); var context = new IncidentContext(); context.setActivityId(execution.getCurrentActivityId()); context.setExecutionId(execution.getProcessInstanceId()); context.setProcessDefinitionId(execution.getProcessDefinitionId()); var newIncident = IncidentEntity.createAndInsertIncident(incidentType, context, incidentMessage); return newIncident; }; Incidents.prototype.resolveIncident = function(incidentId){ execution.getProcessEngineServices() .getRuntimeService() .createIncidentQuery() .incidentId(incidentId) .singleResult() .resolve(); }
          Hide
          matthijs.burke Matthijs Burke added a comment -
          Show
          matthijs.burke Matthijs Burke added a comment - Proofread commit (with a typo in the commit message): https://github.com/camunda/camunda-docs-manual/commit/07cddec6f8da46814d51adb1497c48be4825b1e4

            People

            • Assignee:
              Unassigned
              Reporter:
              meyer Daniel Meyer
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: