고급 사용자 정의 > Windchill 어댑터 > Windchill Adapter Webject Library > Action Webjects > Apply-Service
  
Apply-Service
The Apply-Service webject invokes a Windchill service. This webject provides a mechanism for supplying the helper class or service method with parameter values from the attributes of objects specified as input to the webject. The TYPE and WHERE, OBJECT_REF, and GROUP_IN parameters specify the input objects.
The specified method can be the name of a static method on the helper class or the name of a service method accessible through the helper class.
When the invoked service requires parameters, an appropriate number of ARG parameters must be specified. If any of the argument types are Windchill objects, then they can be supplied using GROUP_IN or can be selected using OBJECT_REF or TYPE and WHERE.
* 
The TYPE and WHERE, OBJECT_REF, and GROUP_IN parameters can be specified in any combination, but at least one must be specified so that the webject has an input object to which to apply the Windchill service.
When no ARG parameters are specified, then the TYPE and WHERE, OBJECT_REF, and GROUP_IN parameters are not required.The webject iterates across all supplied input objects applying the specified Windchill service to each one. The output group returned by the webject contains the cumulative results.
Syntax
<ie:webject name="Apply-Service" type="ACT">
<ie:param name="ACCEPT_LANGUAGE"
data="$(@SERVER[]accept_language[])"/>
<ie:param name="ARG" data="argument"/>
<ie:param name="ATTRIBUTE" data="attribute"/>
<ie:param name="AUTHORIZATION"
data="$(@SERVER[]authorization[0])"/>
<ie:param name="CONNECTION_ATTEMPTS" data="attempts"/>
<ie:param name="CONNECTION_ATTEMPT_INTERVAL" data="interval"/>
<ie:param name="CONTAINER_REF" data="[ufid | MEMBERSHIP]"/>
<ie:param name="DBUSER" data="username"/>
<ie:param name="DESCRIPTOR" data="attribute_name"/>
<ie:param name="FORMAT" data="[TRUE | FALSE]"/>
<ie:param name="GROUP_FILTER" data="group_name"/>
<ie:param name="GROUP_IN" data="group_in"/>
<ie:param name="GROUP_OUT" data="group_out"/>
<ie:param name="INCLUDE_ARGS" data="[TRUE | FALSE]"/>
<ie:param name="INCLUDE_CONSTRAINTS" data="[TRUE | FALSE]"/>
<ie:param name="INCLUDE_DESCRIPTORS" data="[TRUE | FALSE]"/>
<ie:param name="INSTANCE" data="appl_name"/>
<ie:param name="METHOD" data="method_name"/>
<ie:param name="NEXT_OP" data="operation_name"/>
<ie:param name="OBJECT_REF" data="ufid"/>
<ie:param name="PASSWD" data="password"/>
<ie:param name="REFERENCE_EXCEPTIONS" data="[TRUE | FALSE]"/>
<ie:param name="SERVICE" data="service_name"/>
<ie:param name="SESSION_ID" data="$(session[]session_id[])"/>
<ie:param name="STATIC" data="[TRUE | FALSE]"/>
<ie:param name="TRANSACTION" data="[TRUE | FALSE]"/>
<ie:param name="TYPE" data="type_name"/>
<ie:param name="UNFORMATED" data="dataType" />
<ie:param name="WHERE" data="where_clause"/>
<ie:param name="WHERE_CASE_SENSITIVITY" data="[TRUE | FALSE]"/>
</ie:webject>
Parameters
Required
Interdependent
Optional
INSTANCE
ARG
ACCEPT_LANGUAGE
GROUP_OUT
AUTHORIZATION
ATTRIBUTE
METHOD
CONTAINER_REF
CONNECTION_ATTEMPTS
SERVICE
DBUSER
CONNECTION_ATTEMPT_INTERVAL
DESCRIPTOR
FORMAT
GROUP_FILTER
SESSION_ID
GROUP_IN
STATIC
INCLUDE_ARGS
TRANSACTION
INCLUDE_CONSTRAINTS
UNFORMATTED
INCLUDE_DESCRIPTORS
NEXT_OP
OBJECT_REF
PASSWD
REFERENCE_EXCEPTIONS
TYPE
WHERE
WHERE_CASE_SENSITIVITY
* 
If a parameter is listed in the table but is not defined below, then it has a common parameter definition. For descriptions of those parameters, see Common Webject Parameters section in Adapter Webjects Overview.
ARG
An argument of the method named by the METHOD parameter. Multiple values can be specified for this parameter in order to supply all of the arguments required by the method. The order and number of the values specified must match the order and number required by the service method.
For example, if a service method requires three arguments of type wt.part.WTPart, java.lang.String, and int, then the webject must have three ARG parameters. These parameters must be specified in the same order as the formal arguments of the service method.
The format of each ARG parameter value is as follows: type=name-or-value
type specifies a Java class name or the name of a Java primitive type, for example wt.part.WTPart, java.lang.String, and int. The type must match the type of the corresponding argument of the service method.
name-or-value specifies either a literal value or the name of an attribute to retrieve from the current input object being processed by the webject.
If an attribute name is specified, the named attribute is retrieved from the current input object and passed to the service method as the value of its argument.
A literal value is a value enclosed by single quotes. When a literal value is specified, the value itself is passed to the service method as the value of its argument.
In either case, if type specifies the name of a class that is a subclass of wt.fc.Persistable, then the webject assumes that name-or-value specifies the UFID of an object. The webject retrieves the object automatically and passes the object to the service method as the value of its argument.
For example, to retrieve the object referenced by the OBID attribute of the current input object and pass it to the service method as an argument of type wt.part.WTPart, specify the parameter in the following format:
<ie:param name="ARG" data="wt.part.WTPart=obid"/>
To retrieve the object referenced by the masterReference attribute of the current input object and pass it to the service method as an argument of type wt.doc.WTDocumentMaster, specify the parameter in the following format:
<ie:param name="ARG" data="wt.doc.WTDocumentMaster=masterReference"/>
CONTAINER_REF
A Windchill context to apply the webject against. This parameter accepts the following types of input:
The UFID of a Windchill context. Multiple UFIDs can be specified for this parameter.
MEMBERSHIP—The query finds only those contexts of which the user is a member.
When this parameter is specified, the scope of queries executed against the TYPE and WHERE parameters are restricted to the associated context.
GROUP_IN
The name of the group containing the objects to which the Windchill service is applied. This parameter can be specified instead of or in addition to TYPE, WHERE, or OBJECT_REF.
If TYPE, WHERE, or OBJECT_REF are not specified, then GROUP_IN must be specified.
GROUP_OUT
The name of the output group that contains the results produced by the service method. If the service method returns business objects (objects that are subclasses of wt.fc.Persistable), then each element of the output group is the normal representation of an object.
If the service method returns another type of result (for example, a simple string), then the output group contains one element with two attributes named class and result.
The class attribute specifies the object type of the result attribute.
The result attribute specifies the actual result value.
This parameter is required.
METHOD
The name of the method to be applied to the input objects. This can be either the name of a service method to which the helper class provides access or the name of a static method defined on the helper class itself. A no argument constructor must exist for the class that gets instantiated, even if the method that you are calling is a static method. This is a required parameter.
OBJECT_REF
The Unique Federation Identifier (UFID) of a Windchill object. Multiple values can be specified for this parameter to identify multiple objects.
This parameter can be used instead of or in combination with WHERE. If WHERE is not specified, then OBJECT_REF must be specified.
SERVICE
The fully qualified Java class name of the helper that provides access to the Windchill service. For example, wt.part.WTPartHelper, wt.folder.FolderHelper, wt.vc.VersionControlHelper, wt.doc.WTDocumentHelper, and so on. This parameter is required.
STATIC
Specifies whether the method name specified by the METHOD parameter is the name of a static method defined on the helper class itself or the name of a service method. Valid values for this parameter are TRUE and FALSE.
If this parameter is specified as TRUE, the method is a static method of the helper class itself. If the parameter is specified as FALSE, then the method is a service method. The default for this parameter is FALSE.
This parameter is optional.
TRANSACTION
Specifies whether the method should be invoked within the context of a database transaction. Valid values for this parameter are TRUE and FALSE.
If this parameter is specified as FALSE, then the method is not invoked within the context of a database transaction. If this parameter is specified as TRUE, then the method is invoked within the context of a database transaction, and changes are automatically rolled back when the method can not be invoked successfully to all specified input objects.
* 
If the method specified by the METHOD parameter creates or updates information in the database and multiple input objects are specified, then you should specify this parameter as TRUE. This ensures that the database is left unchanged in case the method cannot be invoked successfully to one or more of the input objects.
TYPE
The object type name. If WHERE is specified, TYPE must also be specified. For more information, see Specifying the TYPE and WHERE Parameters.
WHERE
A query expression identifying the objects for which to query. This parameter can be used instead of or in combination with OBJECT_REF.
If OBJECT_REF is not specified, WHERE must be specified. If WHERE is specified, TYPE must also be specified. For more information, see Specifying the TYPE and WHERE Parameters.
The default for this parameter is FALSE. This parameter is optional.
To pass a literal string to the service method, specify the parameter in the following format:
<ie:param name="ARG" data="java.lang.String='foo'"/>