Article
The Identity Manager User Application includes a workflow system that executes approval flows. A workflow process is based on a provisioning request definition, which is an XML document stored in the Identity Vault. The provisioning request definition describes an arbitrary topology using activities and links. For example, a provisioning request to grant an entitlement might have a workflow that collects approvals from relevant users and writes the entitlement to the directory.
To support access by third-party software applications, the provisioning workflow system includes a Web service endpoint. The endpoint offers all provisioning functionality (for example, allowing SOAP clients to start a new approval flow, or list currently executing flows). The Web service is built using the Novell Web Service SDK (WSSDK), which supports the WS-I Basic Profile, thus guaranteeing interoperability with other standards based SOAP implementations.
This article provides sample java code to start a workflow using SOAP Web service.
Prerequisites
To develop a Java client you must install a supported Java Developer’s Kit. Also, a client program needs the following JAR files:
* activation.jar
* commons-httpclient.jar
* IDMfw.jar
* log4j.jar
* saaj-api.jar
* wssdk.jar
* commons-codec-1.3.jar
* commons-logging.jar
* jaxrpc-api.jar
* mail.jar
* workflow.jar
* xpp3.jar
import javax.naming.InitialContext;
import com.novell.soa.af.impl.soap.AdminException;
import com.novell.soa.af.impl.soap.DataItemArray;
import com.novell.soa.af.impl.soap.Provisioning;
import com.novell.soa.af.impl.soap.ProvisioningRequest;
import com.novell.soa.af.impl.soap.ProvisioningRequestArray;
import com.novell.soa.af.impl.soap.ProvisioningService;
import com.novell.soa.af.impl.soap.StringArray;
import com.novell.soa.ws.portable.Stub;
public class Client2 {
private static final String USERNAME = "uaadmin";
private static final String PASSWORD = "novell";
public static void main(String[] args) throws AdminException
{
try {
String url = args.length > 0 ? args[0] :
"http://localhost:8180/IDMProv/provisioning/service";
startworkflow(url);
} catch (Exception ex) {
ex.printStackTrace();
}
}
private static void startworkflow(String url) throws Exception {
InitialContext ctx = new InitialContext();
ProvisioningService service = (ProvisioningService) ctx.lookup("xmlrpc:soap:com.novell.soa.af.impl.soap.ProvisioningService");
Provisioning prov = service.getProvisioningPort();
//Set up the stup(credentials,etc)
Stub stub = (Stub) prov;
// set username and password
stub._setProperty(Stub.USERNAME_PROPERTY, USERNAME);
stub._setProperty(Stub.PASSWORD_PROPERTY, PASSWORD);
// set the endpoint URL
stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, url);
ProvisioningRequestArray provReqArray = prov.getAllProvisioningRequests("cn=uaadmin,ou=sa,o=data");
ProvisioningRequest [] provRequest = provReqArray.getProvisioningrequest();
if(provRequest != null)
{
for (ProvisioningRequest provisioningRequest : provRequest) {
if(provisioningRequest.getName().contains("myrole"))
{
DataItemArray itemArray = provisioningRequest.getItems();
StringArray ValueVal = new StringArray();
String[] StringVal ={"Provide me the resource2"};
ValueVal.setString(StringVal);
itemArray.getDataitem()[0].setValue(ValueVal);
prov.start("cn=myrole,cn=RequestDefs,cn=AppConfig,cn=User Application Driver,cn=driverset1,o=system", "cn=uaadmin,ou=s,o=data", itemArray);
}
}
}
}
}
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.
Related Articles
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- 2751 reads



0