/**
 * JBoss, Home of Professional Open Source.
 * Copyright 2014 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.pnc.bpm.task;

import lombok.ToString;
import org.jboss.pnc.bpm.BpmTask;
import org.jboss.pnc.rest.restmodel.bpm.BpmBuildConfigurationCreationRest;
import org.jboss.pnc.spi.exception.CoreException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;

/**
 * @author Jakub Senko
 */
@ToString(callSuper = true)
public class BpmBuildConfigurationCreationTask extends BpmTask {

    private static final Logger logger = LoggerFactory.getLogger(BpmBuildConfigurationCreationTask.class);

    private final BpmBuildConfigurationCreationRest taskData;

    public BpmBuildConfigurationCreationTask(BpmBuildConfigurationCreationRest taskData, String accessToken) {
        this.taskData = taskData;
        setAccessToken(accessToken);
    }

    @Override
    protected Serializable getProcessParameters() throws CoreException {
        return taskData;
    }

    @Override
    protected String getProcessId() {
        return config.getBcCreationProcessId();
    }

}

@@ -730,16 +730,75 @@
 .task;%0A%0A
+import com.fasterxml.jackson.core.JsonProcessingException;%0A
 import l
@@ -813,16 +813,16 @@
 String;%0A
-
 import o
@@ -1058,16 +1058,64 @@
 lizable;
+%0Aimport java.util.HashMap;%0Aimport java.util.Map;
 %0A%0A/**%0A *
@@ -1680,24 +1680,25 @@
 ption %7B%0A
+%0A
         
 return t
@@ -1693,24 +1693,451 @@
     
-return taskData;
+try %7B%0A            HashMap%3CString, String%3E params = new HashMap%3C%3E();%0A            params.put(%22pncBaseUrl%22, config.getPncBaseUrl());%0A            params.put(%22repourBaseUrl%22, config.getRepourBaseUrl());%0A            params.put(%22taskData%22, MAPPER.writeValueAsString(taskData));%0A            return params;%0A        %7D catch (JsonProcessingException e) %7B%0A            throw new CoreException(%22BC Creation task could not get its parameters.%22, e);%0A        %7D
 %0A   

Fix missing BCC task params.