Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.kie.remote.services.util;
 
 import java.util.Map;
 
 import  org.jbpm.services.task.commands.TaskCommand;
 import  org.jbpm.services.task.impl.model.xml.JaxbContent;
 import  org.jbpm.services.task.impl.model.xml.JaxbTask;
 import  org.kie.api.task.model.Content;
 import  org.kie.api.task.model.Task;
import  org.kie.internal.command.Context;
public class ExecuteAndSerializeCommand extends TaskCommand<Object>{
    private TaskCommand command;
    public ExecuteAndSerializeCommand(){
    }
    public ExecuteAndSerializeCommand(TaskCommand command) {
        this. = command;
    }
    @Override
    public Object execute(Context context) {
        Object cmdResult =  .execute(context);
        ifcmdResult == null ) {
            return null;
        }
        ifcmdResult instanceof Task) {
            cmdResult = new JaxbTask((Task) cmdResult);
        } else ifcmdResult instanceof Content) {
            cmdResult = new JaxbContent((Content) cmdResult);
        } else if (cmdResult instanceof Map) {
            Map output = (MapcmdResult;
            cmdResult = new JaxbContent();
            ((JaxbContent) cmdResult).setContentMap(output);
            ((JaxbContent) cmdResult).setId(-1L);
        }
        return cmdResult;
    }
New to GrepCode? Check out our FAQ X