Tabnine Logo
TaskCommentList
Code IndexAdd Tabnine to your IDE (free)

How to use
TaskCommentList
in
org.kie.server.api.model.instance

Best Java code snippets using org.kie.server.api.model.instance.TaskCommentList (Showing top 2 results out of 315)

origin: org.kie.server/kie-server-client

@Override
public List<TaskComment> getTaskCommentsByTaskId(String containerId, Long taskId) {
  TaskCommentList commentList = null;
  if( config.isRest() ) {
    Map<String, Object> valuesMap = new HashMap<String, Object>();
    valuesMap.put(CONTAINER_ID, containerId);
    valuesMap.put(TASK_INSTANCE_ID, taskId);
    commentList = makeHttpGetRequestAndCreateCustomResponse(
        build(loadBalancer.getUrl(), TASK_URI + "/" + TASK_INSTANCE_COMMENTS_GET_URI, valuesMap), TaskCommentList.class);
  } else {
    CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand)
        new DescriptorCommand( "UserTaskService", "getCommentsByTaskId", marshaller.getFormat().getType(), new Object[]{containerId, taskId}) ) );
    ServiceResponse<String> response = (ServiceResponse<String>) executeJmsCommand( script, DescriptorCommand.class.getName(), "BPM", containerId ).getResponses().get(0);
    throwExceptionOnFailure(response);
    if (shouldReturnWithNullResponse(response)) {
      return null;
    }
    commentList = deserialize(response.getResult(), TaskCommentList.class);
  }
  if (commentList.getTasks() != null) {
    return Arrays.asList(commentList.getTasks());
  }
  return Collections.emptyList();
}
origin: org.kie.server/kie-server-services-jbpm

public String getCommentsByTaskId(String containerId, Number taskId, String marshallingType) {
  containerId = context.getContainerId(containerId, new ByTaskIdContainerLocator(taskId.longValue()));
  List<Comment> comments = userTaskService.getCommentsByTaskId(containerId, taskId.longValue());
  TaskComment[] taskComments = new TaskComment[comments.size()];
  int counter = 0;
  for (Comment comment : comments) {
    TaskComment taskComment = TaskComment.builder()
        .id(comment.getId())
        .text(comment.getText())
        .addedBy(comment.getAddedBy().getId())
        .addedAt(comment.getAddedAt())
        .build();
    taskComments[counter] = taskComment;
    counter++;
  }
  TaskCommentList result = new TaskCommentList(taskComments);
  logger.debug("About to marshal task '{}' comments {}", taskId, result);
  String response = marshallerHelper.marshal(containerId, marshallingType, result);
  return response;
}
org.kie.server.api.model.instanceTaskCommentList

Most used methods

  • <init>
  • getTasks

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now