blob: bddb39faf51ddc59c181a51966d45b9512caaa83 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/**************************************************************************
* CreateNewItem
*
* Copyright (C) 2005 CERN - European Organization for Nuclear Research
* All rights reserved.
**************************************************************************/
package com.c2kernel.lifecycle.instance.predefined.entitycreation;
import com.c2kernel.common.InvalidDataException;
import com.c2kernel.lifecycle.instance.predefined.PredefinedStep;
import com.c2kernel.lookup.AgentPath;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
public class CreateNewItem extends PredefinedStep
{
public CreateNewItem()
{
super();
getProperties().put("SchemaType", "Item");
}
//requestdata is xmlstring
@Override
protected String runActivityLogic(AgentPath agent, int itemSysKey,
int transitionID, String requestData) throws InvalidDataException {
try {
NewItem item = (NewItem)Gateway.getMarshaller().unmarshall(requestData);
item.create(agent.getSysKey(), false);
return requestData;
} catch (Exception ex) {
Logger.error(ex);
throw new InvalidDataException("Error creating item", "");
}
}
}
|