It's all about the answers!

Ask a question

Extending process template programmatically


G D (3642) | asked Jul 17 '09, 10:11 a.m.
Hello,

it is possible to extend a process template in a programming way.

If i have the IProcessDefinition, i want to add some roles, iterations or operations.

I can't manipulate the process_specification, because it is internal(com.ibm.team.process.internal.common.model)

Is there another way, how i can read/write the process specification without to create my own process specification model?

best regards

6 answers



permanent link
Jared Burns (4.5k29) | answered Jul 20 '09, 10:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Fri, 17 Jul 2009 14:23:02 +0000, gd wrote:
it is possible to extend a process template in a programming way.

If i have the IProcessDefinition, i want to add some roles, iterations
or operations.

There is no API for modifying process definitions this way. The intention
is that only end users modify the process definitions in the database and
we provide UI for that.


--
Jared Burns
Jazz Process Team

permanent link
Mark Ingebretson (58515236) | answered Jul 20 '09, 5:19 p.m.
Jared Burns wrote:

There is no API for modifying process definitions this way. The intention
is that only end users modify the process definitions in the database and
we provide UI for that.

I thought I'd make a point here that this is not the deployment model
for all RTC and Jazz customers.

For example, our admin team controls the process template deployed to
our users such that end-users do not update the process template. We
also have the need to programmatically deploy the same template changes
to hundreds of projects.

permanent link
Jared Burns (4.5k29) | answered Jul 21 '09, 8:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Mon, 20 Jul 2009 16:19:19 -0500, Mark Ingebretson wrote:

Jared Burns wrote:

There is no API for modifying process definitions this way. The
intention is that only end users modify the process definitions in the
database and we provide UI for that.

I thought I'd make a point here that this is not the deployment model
for all RTC and Jazz customers.

For example, our admin team controls the process template deployed to
our users such that end-users do not update the process template. We
also have the need to programmatically deploy the same template changes
to hundreds of projects.

When we make programmatic changes to the process specification during
migration, we make text-based (not model-based) edits and I would
recommend this approach to anyone else considering changing the spec. If
you make a model, alter it, and then serialize it, you will usually end
up with a bunch of formatting changes which will make it very difficult
for users to diff changes to the specification in their history.

If you're just asking how to read/write the spec, you need to:

1. Fetch the process definition using the IItemManager (client)
or IRepositoryItemService (server).
2. Get the spec content from the definition:
IContent spec = (IContent) definition.getProcessData().get(ProcessContentKeys.PROCESS_SPECIFICATION_KEY);
3. Read the spec data from the database using the IContentManager (client)
or IContentService (server).
4. Make your edits.
5. Create a new IContent from the new specification string using the content manager or service.
6. Put the new IContent in the definition:
definition.getProcessData().put(ProcessContentKeys.PROCESS_SPECIFICATION_KEY, newContent);
7. Save the definition using the IProcessClientService (client) or IProcessServerService (server)


--
Jared Burns
Jazz Process Team

permanent link
Martha (Ruby) Andrews (3.0k44251) | answered Jul 21 '09, 12:59 p.m.
JAZZ DEVELOPER
Hi Mark,

In your case the "end users" for modifying the process definition that Jared mentions would be your admin team. The team can modify a template using the editing support the UI and then create projects based on the changed template. The team could also export the template and import it into other repositories as needed.

If I've misunderstood what you are trying to do, please correct me.

Martha
Jazz Process Developer

Jared Burns wrote:

There is no API for modifying process definitions this way. The intention
is that only end users modify the process definitions in the database and
we provide UI for that.

I thought I'd make a point here that this is not the deployment model
for all RTC and Jazz customers.

For example, our admin team controls the process template deployed to
our users such that end-users do not update the process template. We
also have the need to programmatically deploy the same template changes
to hundreds of projects.

permanent link
Shlomit Shachor (361210) | answered Jun 08 '10, 10:51 a.m.
JAZZ DEVELOPER
Hi,

I need to create work items from a WI template via a java program. What APIs I should use to do it (a WI template exist in the project area where I want to create the WIs)?


Thanks!

permanent link
Eduardo Bello (4401922) | answered Jun 08 '11, 10:14 a.m.
Hi Jared,

I'm having trouble at step 4. Make your edits..

I'm trying to add an ILiteral value to an IEnumeration. Do you have any ideas how can I do it?


On Mon, 20 Jul 2009 16:19:19 -0500, Mark Ingebretson wrote:

When we make programmatic changes to the process specification during
migration, we make text-based (not model-based) edits and I would
recommend this approach to anyone else considering changing the spec. If
you make a model, alter it, and then serialize it, you will usually end
up with a bunch of formatting changes which will make it very difficult
for users to diff changes to the specification in their history.

If you're just asking how to read/write the spec, you need to:

1. Fetch the process definition using the IItemManager (client)
or IRepositoryItemService (server).
2. Get the spec content from the definition:
IContent spec = (IContent) definition.getProcessData().get(ProcessContentKeys.PROCESS_SPECIFICATION_KEY);
3. Read the spec data from the database using the IContentManager (client)
or IContentService (server).
4. Make your edits.
5. Create a new IContent from the new specification string using the content manager or service.
6. Put the new IContent in the definition:
definition.getProcessData().put(ProcessContentKeys.PROCESS_SPECIFICATION_KEY, newContent);
7. Save the definition using the IProcessClientService (client) or IProcessServerService (server)


--
Jared Burns
Jazz Process Team

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.