private void deployArtifacts() throws RemoteException { String bpelArchiveName = processName + BPELDeployer.Constants.ZIP_EXT; String archiveHome = System.getProperty(BPELDeployer.Constants.TEMP_DIR_PROPERTY) + File.separator; DataSource bpelDataSource = new FileDataSource(archiveHome + bpelArchiveName); WorkflowDeployerClient workflowDeployerClient = new WorkflowDeployerClient( bpsProfile.getManagerHostURL(), bpsProfile.getUsername(), bpsProfile.getPassword().toCharArray()); workflowDeployerClient.uploadBPEL( getBPELUploadedFileItem( new DataHandler(bpelDataSource), bpelArchiveName, BPELDeployer.Constants.ZIP_TYPE)); String htArchiveName = htName + BPELDeployer.Constants.ZIP_EXT; DataSource htDataSource = new FileDataSource(archiveHome + htArchiveName); workflowDeployerClient.uploadHumanTask( getHTUploadedFileItem( new DataHandler(htDataSource), htArchiveName, BPELDeployer.Constants.ZIP_TYPE)); }
public void addBPSProfile(BPSProfile bpsProfileDTO) throws WorkflowImplException { try { int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); WorkflowImplServiceDataHolder.getInstance() .getWorkflowImplService() .addBPSProfile(bpsProfileDTO, tenantId); } catch (WorkflowImplException e) { log.error("Server error when adding the profile " + bpsProfileDTO.getProfileName(), e); throw new WorkflowImplException("Server error occurred when adding the BPS profile"); } }
private Map<String, String> getPlaceHolderValues() { Map<String, String> placeHolderValues = new HashMap<>(); placeHolderValues.put(BPELDeployer.Constants.BPEL_PROCESS_NAME, processName); placeHolderValues.put(BPELDeployer.Constants.HT_SERVICE_NAME, htName); String url = bpsProfile.getWorkerHostURL() != null ? bpsProfile.getWorkerHostURL() : ""; if (url.endsWith("/")) { url = url.substring(0, url.lastIndexOf("/")); } placeHolderValues.put(BPELDeployer.Constants.BPS_HOST_NAME, url); placeHolderValues.put(Constants.URL_TENANT_CONTEXT, tenantContext); placeHolderValues.put( BPELDeployer.Constants.CARBON_HOST_NAME, BPELDeployer.Constants.CARBON_HOST_URL); placeHolderValues.put( BPELDeployer.Constants.CARBON_CALLBACK_AUTH_USER, (bpsProfile.getCallbackUser() != null ? bpsProfile.getCallbackUser() : "")); placeHolderValues.put( BPELDeployer.Constants.CARBON_CALLBACK_AUTH_PASSWORD, (bpsProfile.getCallbackPassword() != null ? bpsProfile.getCallbackPassword() : "")); placeHolderValues.put(BPELDeployer.Constants.HT_OWNER_ROLE, role); placeHolderValues.put(BPELDeployer.Constants.HT_ADMIN_ROLE, role); return placeHolderValues; }