create repository workspace by loading two different components from different streams
5 answers
In Eclipse this is as simple as opening the workspace up, going to the Components section, and hitting 'Add' -> 'Component in another repository workspace or stream' and then add your 2 components from the different streams. Then you can optionally add those streams to your flow targets so you can subscribe to the incoming changes.
If you want to do this via the command-line as part of a headless build process:
1. Create an empty workspace using '--empty' as per https://jazz.net/help-dev/clm/topic/com.ibm.team.scm.doc/topics/create_workspace.html
2. Add the components from both streams as per https://jazz.net/help-dev/clm/topic/com.ibm.team.scm.doc/topics/add_component.html
3. Optionally add your flow targets to the workspace to subscribe to component/stream updates as per https://jazz.net/help-dev/clm/topic/com.ibm.team.scm.doc/topics/add_flowtarget.html
Another option if you don't want to script all this is to just setup your workspace in Eclipse, then simply run a load on the workspace from your build process to pull it down, this way you keep the complexity of constructing the workspace in the GUI (which is easier for many people to manage) rather than trying to convey it in scripts that people may not understand enough to augment down the line when you inevitably add more components and streams.
Another option is to use load rules covered at https://jazz.net/library/article/1015
These can capture a very complicated load setup for a workspace but make it very easy for end-users to consume and work with without knowing the specifics of the magic going on underneath.
Comments
Note that adding the components from the different streams will give you the configuration of those components at the time added. You'll still want to update the components when necessary but get the updates from the correct sources. This kind of flow with multiple flow targets for your build stream isn't supported in a way that persists the multiple flow targets.
Comments
"i want to create one Snapshot for each build and that should be recorded with stream itself so that will have record for past builds. "
My original recommendation was just if you wanted a cheap throw-away build workspace that had components from multiple streams.
If you want snapshots recorded on this specific stream, you're going to have to go multi-stream as Tim Mok suggested.
As Tim said, you'll need some type of 'downstream' build stream that contains all these components for your build, and you'll have to flow with your 'upstream' dependencies to get the components and changesets you want for the build, in your example SourceCode_Stream would push its changesets to this build stream for the component 'SourceCode_Comp' and your other stream 'HelpFiles_Stream' would push its changesets to this build stream for the component 'HelpFiles_Comp'.
Once the build is done, the snapshot would be created in the build workspace, and you could use the CLI to reassign ownership of the snapshot (what used to be called 'promote') to the build stream to capture the configuration of all the components and their baselines.